Skip to content

Commit

Permalink
Merge 10.2 to 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 13, 2019
2 parents eedd617 + ed4ccf3 commit 65d48b4
Show file tree
Hide file tree
Showing 81 changed files with 1,700 additions and 984 deletions.
2 changes: 1 addition & 1 deletion BUILD/compile-pentium64-asan-max
Expand Up @@ -17,7 +17,7 @@
path=`dirname $0`
. "$path/SETUP.sh"

extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address"
extra_flags="$pentium64_cflags $debug_cflags -lasan -O -g -fsanitize=address -USAFEMALLOC -UFORCE_INIT_OF_VARS -Wno-uninitialized -Wno-maybe-uninitialized"
extra_configs="$pentium_configs $debug_configs $valgrind_configs $max_configs $disable_asan_plugins"
export LDFLAGS="-ldl"

Expand Down
3 changes: 2 additions & 1 deletion extra/innochecksum.cc
Expand Up @@ -568,7 +568,8 @@ is_page_corrupted(
page_size);
if (is_corrupted && log_file) {
fprintf(log_file,
"Page " ULINTPF ":%llu may be corrupted;"
"[page id: space=" ULINTPF
", page_number=%llu] may be corrupted;"
" key_version=%u\n",
space_id, cur_page_num,
mach_read_from_4(
Expand Down
2 changes: 1 addition & 1 deletion extra/mariabackup/xtrabackup.cc
Expand Up @@ -1295,7 +1295,7 @@ struct my_option xb_server_options[] =
{"innodb_log_file_size", OPT_INNODB_LOG_FILE_SIZE,
"Ignored for mysqld option compatibility",
(G_PTR*) &srv_log_file_size, (G_PTR*) &srv_log_file_size, 0,
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20, 512ULL << 30, 0,
GET_ULL, REQUIRED_ARG, 48 << 20, 1 << 20, log_group_max_size, 0,
UNIV_PAGE_SIZE_MAX, 0},
{"innodb_log_files_in_group", OPT_INNODB_LOG_FILES_IN_GROUP,
"Ignored for mysqld option compatibility",
Expand Down
11 changes: 9 additions & 2 deletions include/my_valgrind.h
Expand Up @@ -55,12 +55,19 @@
#endif /* HAVE_VALGRIND_MEMCHECK_H */

#if defined(TRASH_FREED_MEMORY)
/* NOTE: Do not invoke TRASH_FILL directly! Use TRASH_ALLOC or TRASH_FREE.
The MEM_UNDEFINED() call before memset() is for canceling the effect
of any previous MEM_NOACCESS(). We must invoke MEM_UNDEFINED() after
writing the dummy pattern, unless MEM_NOACCESS() is going to be invoked.
On AddressSanitizer, the MEM_UNDEFINED() in TRASH_ALLOC() has no effect. */
#define TRASH_FILL(A,B,C) do { const size_t trash_tmp= (B); MEM_UNDEFINED(A, trash_tmp); memset(A, C, trash_tmp); } while (0)
#else
#define TRASH_FILL(A,B,C) do { MEM_UNDEFINED((A), (B)); } while (0)
#define TRASH_FILL(A,B,C) while (0)
#endif

/** Note that some memory became allocated or uninitialized. */
#define TRASH_ALLOC(A,B) do { TRASH_FILL(A,B,0xA5); MEM_UNDEFINED(A,B); } while(0)
/** Note that some memory became freed. (Prohibit further access to it.) */
#define TRASH_FREE(A,B) do { TRASH_FILL(A,B,0x8F); MEM_NOACCESS(A,B); } while(0)

#endif /* MY_VALGRIND_INCLUDED */
2 changes: 1 addition & 1 deletion mysql-test/include/wait_for_slave_param.inc
Expand Up @@ -69,7 +69,7 @@ if (!$_slave_param_comparison)

if ($rpl_debug)
{
--echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [timeout='$_slave_timeout', \$slave_error_param='$slave_error_param']
--echo Waiting until '$slave_param' $_slave_param_comparison '$slave_param_value' [\$slave_error_param='$slave_error_param']
}

--let $_slave_check_configured= query_get_value("SHOW SLAVE STATUS", Slave_IO_Running, 1)
Expand Down
1 change: 1 addition & 0 deletions mysql-test/main/connect_debug.test
Expand Up @@ -17,6 +17,7 @@ drop user bad;
#
set global debug_dbug='+d,auth_invalid_plugin';
create user 'bad' identified by 'worse';
--replace_regex /loaded: [^\n]*/loaded: invalid plugin name/
--error 1
--exec $MYSQL --default-auth=mysql_old_password --user=bad --password=worse 2>&1
set global debug_dbug=@old_dbug;
Expand Down
16 changes: 16 additions & 0 deletions mysql-test/main/kill.result
Expand Up @@ -399,3 +399,19 @@ DROP USER u1@localhost;
SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;
set global sql_mode=default;
#
# MDEV-17998
# Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
# in tc_release_table on KILL_TIMEOUT
#
SET max_statement_time= 2;
CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 (b INT, c INT);
LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
Got one of the listed errors
ALTER TABLE t2 DROP c;
UNLOCK TABLES;
DROP VIEW v1;
DROP TABLE t1, t2;
20 changes: 20 additions & 0 deletions mysql-test/main/kill.test
Expand Up @@ -642,3 +642,23 @@ SET DEBUG_SYNC = 'RESET';
DROP FUNCTION MY_KILL;

set global sql_mode=default;

--echo #
--echo # MDEV-17998
--echo # Deadlock and eventual Assertion `!table->pos_in_locked_tables' failed
--echo # in tc_release_table on KILL_TIMEOUT
--echo #

SET max_statement_time= 2;

CREATE TABLE t1 (a INT);
CREATE VIEW v1 AS SELECT * FROM t1;
CREATE TABLE t2 (b INT, c INT);

LOCK TABLES v1 READ, t2 WRITE, t1 WRITE;
--error ER_BAD_FIELD_ERROR,ER_STATEMENT_TIMEOUT
ALTER TABLE t1 CHANGE f1 f2 DOUBLE;
ALTER TABLE t2 DROP c;
UNLOCK TABLES;
DROP VIEW v1;
DROP TABLE t1, t2;
1 change: 1 addition & 0 deletions mysql-test/mysql-test-run.pl
Expand Up @@ -3329,6 +3329,7 @@ sub mysql_install_db {
# Create the bootstrap.sql file
# ----------------------------------------------------------------------
my $bootstrap_sql_file= "$opt_vardir/log/bootstrap.sql";
$ENV{'MYSQL_BOOTSTRAP_SQL_FILE'}= $bootstrap_sql_file;

if (! -e $bootstrap_sql_file)
{
Expand Down
2 changes: 2 additions & 0 deletions mysql-test/suite/binlog/r/binlog_unsafe.result
Expand Up @@ -2675,6 +2675,8 @@ Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. CREATE... REPLACE SELECT is unsafe because the order in which rows are retrieved by the SELECT determines which (if any) rows are replaced. This order cannot be predicted and may differ on master and the slave
INSERT INTO insert_2_keys VALUES (1, 2)
ON DUPLICATE KEY UPDATE a=VALUES(a)+10, b=VALUES(b)+10;
Warnings:
Note 1592 Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. INSERT... ON DUPLICATE KEY UPDATE on a table with more than one UNIQUE KEY is unsafe
DROP TABLE filler_table;
DROP TABLE insert_table;
DROP TABLE update_table;
Expand Down
3 changes: 0 additions & 3 deletions mysql-test/suite/galera/disabled.def
Expand Up @@ -11,9 +11,6 @@
##############################################################################

MW-286 : MDEV-19992 Galera test failure on MW-286
MW-328A : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328B : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-328C : MDEV-17847 Galera test failure on MW-328[A|B|C]
MW-329 : MDEV-19962 Galera test failure on MW-329
MW-388: MDEV-19803 Long semaphore wait error on galera.MW-388
galera_account_management : MariaDB 10.0 does not support ALTER USER
Expand Down
25 changes: 20 additions & 5 deletions mysql-test/suite/galera/r/MW-328A.result
Expand Up @@ -14,14 +14,29 @@ connection node_1X;
CALL proc_update();;
connection node_2;
SET SESSION wsrep_retry_autocommit = 0;
have_successes
1
have_deadlocks
1
connection node_1;
connection node_1X;
Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CALL mtr.add_suppression("conflict state ABORTED after post commit");
connection node_1;
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
INSERT INTO t1 values (1,0);
BEGIN;
UPDATE t1 SET j=1 WHERE i=1;
connection node_2;
UPDATE t1 SET j=2 WHERE i=1;
connection node_1;
COMMIT;
ERROR 40001: Deadlock: wsrep aborted transaction
SELECT * FROM t1;
i j
1 2
connection node_2;
SELECT * FROM t1;
i j
1 2
connection node_1;
DROP TABLE t1;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/MW-328B.result
Expand Up @@ -20,4 +20,4 @@ Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CALL mtr.add_suppression("conflict state ABORTED after post commit");
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/r/MW-328C.result
Expand Up @@ -20,4 +20,4 @@ Got one of the listed errors
connection node_1;
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;
CALL mtr.add_suppression("conflict state 3 after post commit");
CALL mtr.add_suppression("conflict state ABORTED after post commit");
44 changes: 44 additions & 0 deletions mysql-test/suite/galera/r/galera_performance_schema.result
@@ -0,0 +1,44 @@
use performance_schema;
SELECT name
FROM threads
WHERE name LIKE 'thread/sql/wsrep%'
ORDER BY name;
name thread/sql/wsrep_applier_thread
name thread/sql/wsrep_rollbacker_thread
use test;
create table t1 (a int not null primary key) engine=innodb;
insert into t1 values (1),(2);
use performance_schema;
select name from mutex_instances where name like 'wait/synch/mutex/sql/LOCK_wsrep%' order by name;
name wait/synch/mutex/sql/LOCK_wsrep_config_state
name wait/synch/mutex/sql/LOCK_wsrep_desync
name wait/synch/mutex/sql/LOCK_wsrep_ready
name wait/synch/mutex/sql/LOCK_wsrep_replaying
name wait/synch/mutex/sql/LOCK_wsrep_rollback
name wait/synch/mutex/sql/LOCK_wsrep_slave_threads
name wait/synch/mutex/sql/LOCK_wsrep_sst
name wait/synch/mutex/sql/LOCK_wsrep_sst_init
select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name;
name wait/synch/cond/sql/COND_wsrep_ready
name wait/synch/cond/sql/COND_wsrep_replaying
name wait/synch/cond/sql/COND_wsrep_rollback
name wait/synch/cond/sql/COND_wsrep_sst
name wait/synch/cond/sql/COND_wsrep_sst_init
connection node_2;
use test;
SET SESSION wsrep_on=OFF;
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
connection node_1;
use test;
CREATE TABLE t2 (f1 INTEGER) engine=innodb;
connection node_2;
SET SESSION wsrep_on=ON;
SELECT COUNT(*) FROM t1;
COUNT(*) 2
use performance_schema;
select count(*)>=1 from file_instances where file_name like '%GRA_%.log';
count(*)>=1 1
CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query");
use test;
drop table t1;
drop table t2;
2 changes: 1 addition & 1 deletion mysql-test/suite/galera/t/MW-328-footer.inc
Expand Up @@ -15,4 +15,4 @@
DROP PROCEDURE proc_update;
DROP TABLE t1, t2;

CALL mtr.add_suppression("conflict state 3 after post commit");
CALL mtr.add_suppression("conflict state ABORTED after post commit");
43 changes: 32 additions & 11 deletions mysql-test/suite/galera/t/MW-328A.test
Expand Up @@ -3,13 +3,17 @@
#

#
# Attempt to insert into t2 and check if insert actually inserted rows if
# a success was reported.
# test phase 1 is not deterministic
#
# Here we attempt to insert into t2 and check if insert actually
# inserted rows if a success was reported.
#
# However, deadlocks may or may not happen in this test execution
# it all depends on timing.
#

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/big_test.inc
--source suite/galera/t/MW-328-header.inc

--connection node_2
Expand All @@ -25,7 +29,7 @@ while ($count)
{
TRUNCATE TABLE t2;

--error 0,1213
--error 0,ER_LOCK_DEADLOCK
INSERT IGNORE INTO t2 SELECT f2 FROM t1;
if ($mysql_errno != 1213) {
--inc $successes
Expand All @@ -44,14 +48,31 @@ while ($count)

--enable_query_log


--source suite/galera/t/MW-328-footer.inc

#
# Check that the test produced both deadlocks and successes
# Test phase 2 is deterministic
# Here we generate a sure conflict in node 1 and verify that
# insert failed in both nodes
#
--connection node_1
CREATE TABLE t1 (i int primary key, j int) engine=innodb;
INSERT INTO t1 values (1,0);

--disable_query_log
--eval SELECT $successes > 0 AS have_successes
--eval SELECT $deadlocks > 0 AS have_deadlocks
--enable_query_log
BEGIN;
UPDATE t1 SET j=1 WHERE i=1;

--connection node_2
UPDATE t1 SET j=2 WHERE i=1;

--source suite/galera/t/MW-328-footer.inc
--connection node_1
--error ER_LOCK_DEADLOCK
COMMIT;

SELECT * FROM t1;
--connection node_2
SELECT * FROM t1;
--connection node_1

DROP TABLE t1;
2 changes: 0 additions & 2 deletions mysql-test/suite/galera/t/MW-328B.test
Expand Up @@ -7,9 +7,7 @@
# gets the deadlock error
#

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source suite/galera/t/MW-328-header.inc

--connection node_2
Expand Down
3 changes: 1 addition & 2 deletions mysql-test/suite/galera/t/MW-328C.test
Expand Up @@ -7,9 +7,8 @@
# masks all deadlock errors
#

--source include/big_test.inc
--source include/galera_cluster.inc
--source include/have_innodb.inc
--source include/big_test.inc
--source suite/galera/t/MW-328-header.inc

--connection node_2
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/galera/t/MW-328D.test
Expand Up @@ -7,7 +7,6 @@
#

--source include/galera_cluster.inc
--source include/have_innodb.inc

CREATE TABLE t1 (i INT) ENGINE = InnoDB;
INSERT INTO t1 (i) VALUES(1);
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/galera/t/MW-328E.test
Expand Up @@ -7,7 +7,6 @@
#

--source include/galera_cluster.inc
--source include/have_innodb.inc

create table t1 (i int primary key, j int) engine=innodb;
create table t2 (i int primary key, j int) engine=innodb;
Expand Down

0 comments on commit 65d48b4

Please sign in to comment.