diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-13 19:28:51 +0300 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2019-08-13 19:28:51 +0300 |
commit | 65d48b4a7bd7a57a27f2e9ca54473e1ae86223b5 (patch) | |
tree | f145a7a095011fbc4e6661e1675f72f6cdca38b6 /mysql-test | |
parent | eedd6179c1e5e8651270b353a693887179ad7bf3 (diff) | |
parent | ed4ccf34a6603bd2374a721a7e1ad88472f335fc (diff) | |
download | mariadb-git-65d48b4a7bd7a57a27f2e9ca54473e1ae86223b5.tar.gz |
Merge 10.2 to 10.3
Diffstat (limited to 'mysql-test')
41 files changed, 926 insertions, 348 deletions
diff --git a/mysql-test/include/wait_for_slave_param.inc b/mysql-test/include/wait_for_slave_param.inc index 25020d46ed9..b06dee3c640 100644 --- a/mysql-test/include/wait_for_slave_param.inc +++ b/mysql-test/include/wait_for_slave_param.inc @@ -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) diff --git a/mysql-test/main/connect_debug.test b/mysql-test/main/connect_debug.test index 7a2f2872b79..300a2de0fbd 100644 --- a/mysql-test/main/connect_debug.test +++ b/mysql-test/main/connect_debug.test @@ -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; diff --git a/mysql-test/main/kill.result b/mysql-test/main/kill.result index dc1cb9252da..e3fbb830df5 100644 --- a/mysql-test/main/kill.result +++ b/mysql-test/main/kill.result @@ -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; diff --git a/mysql-test/main/kill.test b/mysql-test/main/kill.test index b6000ffced1..e5ebdadd8a8 100644 --- a/mysql-test/main/kill.test +++ b/mysql-test/main/kill.test @@ -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; diff --git a/mysql-test/mysql-test-run.pl b/mysql-test/mysql-test-run.pl index bd1034adfe1..35fefec5e4f 100755 --- a/mysql-test/mysql-test-run.pl +++ b/mysql-test/mysql-test-run.pl @@ -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) { diff --git a/mysql-test/suite/binlog/r/binlog_unsafe.result b/mysql-test/suite/binlog/r/binlog_unsafe.result index d235237c69c..a8143ef086e 100644 --- a/mysql-test/suite/binlog/r/binlog_unsafe.result +++ b/mysql-test/suite/binlog/r/binlog_unsafe.result @@ -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; diff --git a/mysql-test/suite/galera/disabled.def b/mysql-test/suite/galera/disabled.def index a688b6abd9a..47f95db937d 100644 --- a/mysql-test/suite/galera/disabled.def +++ b/mysql-test/suite/galera/disabled.def @@ -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 diff --git a/mysql-test/suite/galera/r/MW-328A.result b/mysql-test/suite/galera/r/MW-328A.result index db0301b6bf2..535f04bfbab 100644 --- a/mysql-test/suite/galera/r/MW-328A.result +++ b/mysql-test/suite/galera/r/MW-328A.result @@ -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; diff --git a/mysql-test/suite/galera/r/MW-328B.result b/mysql-test/suite/galera/r/MW-328B.result index e898e315ca8..531c5de8029 100644 --- a/mysql-test/suite/galera/r/MW-328B.result +++ b/mysql-test/suite/galera/r/MW-328B.result @@ -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"); diff --git a/mysql-test/suite/galera/r/MW-328C.result b/mysql-test/suite/galera/r/MW-328C.result index d8e164e7b4a..f8d747c5df1 100644 --- a/mysql-test/suite/galera/r/MW-328C.result +++ b/mysql-test/suite/galera/r/MW-328C.result @@ -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"); diff --git a/mysql-test/suite/galera/r/galera_performance_schema.result b/mysql-test/suite/galera/r/galera_performance_schema.result new file mode 100644 index 00000000000..5b4994556d6 --- /dev/null +++ b/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; diff --git a/mysql-test/suite/galera/t/MW-328-footer.inc b/mysql-test/suite/galera/t/MW-328-footer.inc index 5b736df220f..12a4bf12590 100644 --- a/mysql-test/suite/galera/t/MW-328-footer.inc +++ b/mysql-test/suite/galera/t/MW-328-footer.inc @@ -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"); diff --git a/mysql-test/suite/galera/t/MW-328A.test b/mysql-test/suite/galera/t/MW-328A.test index 09aad1bcf60..dd692a292b8 100644 --- a/mysql-test/suite/galera/t/MW-328A.test +++ b/mysql-test/suite/galera/t/MW-328A.test @@ -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 @@ -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 @@ -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; diff --git a/mysql-test/suite/galera/t/MW-328B.test b/mysql-test/suite/galera/t/MW-328B.test index 000b0d8a9ab..11969dd0b47 100644 --- a/mysql-test/suite/galera/t/MW-328B.test +++ b/mysql-test/suite/galera/t/MW-328B.test @@ -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 diff --git a/mysql-test/suite/galera/t/MW-328C.test b/mysql-test/suite/galera/t/MW-328C.test index 72a8480923c..1594547d0de 100644 --- a/mysql-test/suite/galera/t/MW-328C.test +++ b/mysql-test/suite/galera/t/MW-328C.test @@ -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 diff --git a/mysql-test/suite/galera/t/MW-328D.test b/mysql-test/suite/galera/t/MW-328D.test index d5cffdb8f47..e8a22f22a99 100644 --- a/mysql-test/suite/galera/t/MW-328D.test +++ b/mysql-test/suite/galera/t/MW-328D.test @@ -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); diff --git a/mysql-test/suite/galera/t/MW-328E.test b/mysql-test/suite/galera/t/MW-328E.test index fd4b0bf9039..34b17be7b08 100644 --- a/mysql-test/suite/galera/t/MW-328E.test +++ b/mysql-test/suite/galera/t/MW-328E.test @@ -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; diff --git a/mysql-test/suite/galera/t/galera_performance_schema.test b/mysql-test/suite/galera/t/galera_performance_schema.test new file mode 100644 index 00000000000..d54555ea301 --- /dev/null +++ b/mysql-test/suite/galera/t/galera_performance_schema.test @@ -0,0 +1,58 @@ +# +# Test that wsrep mutexes, condition variables, files and +# threads are shown in performance schema +# +--source include/galera_cluster.inc +--source include/have_perfschema.inc + +use performance_schema; + +--vertical_results +--disable_ps_protocol +SELECT name +FROM threads +WHERE name LIKE 'thread/sql/wsrep%' +ORDER BY name; +--enable_ps_protocol + +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; +select name from cond_instances where name like 'wait/synch/cond/sql/COND_wsrep%' order by name; +# Whenever a node fails to apply an event on a slave node, the database server creates a +# special binary log file of the event in the data directory. The naming convention the +# node uses for the filename is GRA_*.log. +# Thus, we need to produce a applier failure + +--connection node_2 +--exec rm -rf $MYSQLTEST_VARDIR/mysqld.2/data/GRA_*.log + +# Create applier failure + +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; + +use performance_schema; +# +# Below we can't just count number of files as if you run this test more +# than once, test will create more files +# +select count(*)>=1 from file_instances where file_name like '%GRA_%.log'; +CALL mtr.add_suppression("Slave SQL: Error 'Table 't2' already exists' on query"); + +use test; +drop table t1; +drop table t2; + diff --git a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc index 48de3a1962d..85466e5e4ae 100644 --- a/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc +++ b/mysql-test/suite/innodb/include/innodb_bulk_create_index_debug.inc @@ -4,17 +4,8 @@ # Not supported in embedded -- source include/not_embedded.inc - -# This test case needs to crash the server. Needs a debug server. -- source include/have_debug.inc - -# Don't test this under valgrind, memory leaks will occur. --- source include/not_valgrind.inc - -# Avoid CrashReporter popup on Mac --- source include/not_crashrep.inc - --- source include/have_innodb.inc +-- source include/have_debug_sync.inc # Create Insert Procedure DELIMITER |; @@ -62,21 +53,11 @@ CALL populate_t1(); SELECT COUNT(*) FROM t1; +--enable_info CREATE INDEX idx_title ON t1(title); +--disable_info ---source include/restart_mysqld.inc - -CHECK TABLE t1; - -SELECT * FROM t1 WHERE title = 'a10'; - -SELECT * FROM t1 WHERE title = 'a5000'; - -SELECT * FROM t1 WHERE title = 'a10000'; - -SELECT * FROM t1 WHERE title = 'a10010'; - -DROP TABLE t1; +RENAME TABLE t1 TO t0; -- echo # Test Blob @@ -104,16 +85,32 @@ INSERT INTO t1 VALUES SELECT CHAR_LENGTH(b) FROM t1; -ALTER TABLE t1 DROP COLUMN c; +--enable_info +ALTER TABLE t1 DROP COLUMN c, FORCE; +--disable_info --source include/restart_mysqld.inc -CHECK TABLE t1; +CHECK TABLE t0,t1; SELECT CHAR_LENGTH(b) FROM t1; DROP TABLE t1; +RENAME TABLE t0 to t1; + +CHECK TABLE t1; + +SELECT * FROM t1 WHERE title = 'a10'; + +SELECT * FROM t1 WHERE title = 'a5000'; + +SELECT * FROM t1 WHERE title = 'a10000'; + +SELECT * FROM t1 WHERE title = 'a10010'; + +DROP TABLE t1; + # Test Crash Recovery if ($row_format != 'COMPRESSED') @@ -140,17 +137,16 @@ if ($row_format == 'COMPRESSED') CALL populate_t1(); -- enable_query_log -SET debug_dbug='+d,crash_commit_before'; - -# Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect - ---error 2013 +connect (hang,localhost,root); +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +send CREATE INDEX idx_title ON t1(title); ---enable_reconnect ---source include/wait_until_connected_again.inc ---disable_reconnect +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +let $shutdown_timeout=0; +--source include/restart_mysqld.inc +disconnect hang; SELECT COUNT(*) FROM t1; @@ -194,17 +190,16 @@ INSERT INTO t1 VALUES SELECT CHAR_LENGTH(b) FROM t1; -SET debug_dbug='+d,crash_commit_before'; - -# Write file to make mysql-test-run.pl start up the server again ---exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect - ---error 2013 -ALTER TABLE t1 DROP COLUMN c; +connect (hang,localhost,root); +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +send +ALTER TABLE t1 DROP COLUMN c, FORCE; ---enable_reconnect ---source include/wait_until_connected_again.inc ---disable_reconnect +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +--source include/restart_mysqld.inc +disconnect hang; +let $shutdown_timeout=60; CHECK TABLE t1; @@ -212,10 +207,4 @@ SELECT CHAR_LENGTH(b) FROM t1; DROP TABLE t1; -# Restore global variables -if ($row_format == 'COMPRESSED') -{ - SET GLOBAL innodb_file_per_table=default; -} - DROP PROCEDURE populate_t1; diff --git a/mysql-test/suite/innodb/r/alter_copy.result b/mysql-test/suite/innodb/r/alter_copy.result index ac25c6c6c18..35f4eb3b2c2 100644 --- a/mysql-test/suite/innodb/r/alter_copy.result +++ b/mysql-test/suite/innodb/r/alter_copy.result @@ -37,7 +37,9 @@ t1 CREATE TABLE `t1` ( FULLTEXT KEY `b_2` (`b`,`c`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 ALTER TABLE t1 FORCE, ALGORITHM=COPY; -SET DEBUG_DBUG='+d,crash_commit_before'; +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever'; +# create 32 secondary indexes ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c), ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c), ADD INDEX(a,c,b,d),ADD INDEX(a,c,d,b),ADD INDEX(a,d,b,c),ADD INDEX(a,d,c,b), @@ -47,7 +49,9 @@ ADD INDEX(d,b,a,c),ADD INDEX(d,b,c,a),ADD INDEX(d,c,a,b),ADD INDEX(d,c,b,a), ADD INDEX(a,b,c), ADD INDEX(a,c,b), ADD INDEX(a,c,d), ADD INDEX(a,d,c), ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c), ALGORITHM=COPY; -ERROR HY000: Lost connection to MySQL server during query +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; #sql-temporary.frm #sql-temporary.ibd FTS_INDEX_1.ibd diff --git a/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff b/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff deleted file mode 100644 index 7b4ec54eed8..00000000000 --- a/mysql-test/suite/innodb/r/auto_increment_dup,skip-log-bin.rdiff +++ /dev/null @@ -1,51 +0,0 @@ ---- auto_increment_dup.result -+++ auto_increment_dup,skip-log-bin.reject -@@ -89,13 +89,14 @@ - SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue'; - affected rows: 0 - INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; --ERROR HY000: Lock wait timeout exceeded; try restarting transaction -+affected rows: 3 -+info: Records: 3 Duplicates: 0 Warnings: 0 - connection con1; - # - # 2 duplicates - # --affected rows: 3 --info: Records: 3 Duplicates: 0 Warnings: 0 -+affected rows: 4 -+info: Records: 3 Duplicates: 1 Warnings: 0 - connection default; - # - # 3 rows -@@ -103,19 +104,21 @@ - SELECT * FROM t1 order by k; - id k c - 1 1 NULL --2 2 NULL --3 3 NULL --affected rows: 3 -+4 2 1 -+2 3 NULL -+5 4 NULL -+6 5 NULL -+affected rows: 5 - INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; --affected rows: 4 --info: Records: 3 Duplicates: 1 Warnings: 0 -+affected rows: 6 -+info: Records: 3 Duplicates: 3 Warnings: 0 - SELECT * FROM t1 order by k; - id k c - 1 1 NULL --2 2 2 --3 3 NULL --7 4 NULL --8 5 NULL -+4 2 2 -+2 3 NULL -+5 4 2 -+6 5 2 - affected rows: 5 - disconnect con1; - disconnect con2; diff --git a/mysql-test/suite/innodb/r/auto_increment_dup.result b/mysql-test/suite/innodb/r/auto_increment_dup.result index 1467a459fc1..9926047b665 100644 --- a/mysql-test/suite/innodb/r/auto_increment_dup.result +++ b/mysql-test/suite/innodb/r/auto_increment_dup.result @@ -89,13 +89,14 @@ affected rows: 0 SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue'; affected rows: 0 INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; -ERROR HY000: Lock wait timeout exceeded; try restarting transaction +affected rows: 3 +info: Records: 3 Duplicates: 0 Warnings: 0 connection con1; # # 2 duplicates # -affected rows: 3 -info: Records: 3 Duplicates: 0 Warnings: 0 +affected rows: 4 +info: Records: 3 Duplicates: 1 Warnings: 0 connection default; # # 3 rows @@ -103,19 +104,21 @@ connection default; SELECT * FROM t1 order by k; id k c 1 1 NULL -2 2 NULL -3 3 NULL -affected rows: 3 +4 2 1 +2 3 NULL +5 4 NULL +6 5 NULL +affected rows: 5 INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; -affected rows: 4 -info: Records: 3 Duplicates: 1 Warnings: 0 +affected rows: 6 +info: Records: 3 Duplicates: 3 Warnings: 0 SELECT * FROM t1 order by k; id k c 1 1 NULL -2 2 2 -3 3 NULL -7 4 NULL -8 5 NULL +4 2 2 +2 3 NULL +5 4 2 +6 5 2 affected rows: 5 disconnect con1; disconnect con2; diff --git a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result index cd5a3c340da..295a9f1bed8 100644 --- a/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result +++ b/mysql-test/suite/innodb/r/innodb_bulk_create_index_debug.result @@ -17,21 +17,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 10000 CREATE INDEX idx_title ON t1(title); -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SELECT * FROM t1 WHERE title = 'a10'; -class id title -10 10 a10 -SELECT * FROM t1 WHERE title = 'a5000'; -class id title -5000 5000 a5000 -SELECT * FROM t1 WHERE title = 'a10000'; -class id title -10000 10000 a10000 -SELECT * FROM t1 WHERE title = 'a10010'; -class id title -DROP TABLE t1; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +RENAME TABLE t1 TO t0; # Test Blob CREATE TABLE t1( a INT PRIMARY KEY, @@ -48,9 +36,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -ALTER TABLE t1 DROP COLUMN c; -CHECK TABLE t1; +ALTER TABLE t1 DROP COLUMN c, FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +CHECK TABLE t0,t1; Table Op Msg_type Msg_text +test.t0 check status OK test.t1 check status OK SELECT CHAR_LENGTH(b) FROM t1; CHAR_LENGTH(b) @@ -59,14 +50,33 @@ CHAR_LENGTH(b) 40000 60000 DROP TABLE t1; +RENAME TABLE t0 to t1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1 WHERE title = 'a10'; +class id title +10 10 a10 +SELECT * FROM t1 WHERE title = 'a5000'; +class id title +5000 5000 a5000 +SELECT * FROM t1 WHERE title = 'a10000'; +class id title +10000 10000 a10000 +SELECT * FROM t1 WHERE title = 'a10010'; +class id title +DROP TABLE t1; CREATE TABLE t1( class INT, id INT, title VARCHAR(100) ) ENGINE=InnoDB ROW_FORMAT=REDUNDANT; -SET debug_dbug='+d,crash_commit_before'; +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; CREATE INDEX idx_title ON t1(title); -ERROR HY000: Lost connection to MySQL server during query +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; SELECT COUNT(*) FROM t1; COUNT(*) 10000 @@ -104,9 +114,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -SET debug_dbug='+d,crash_commit_before'; -ALTER TABLE t1 DROP COLUMN c; -ERROR HY000: Lost connection to MySQL server during query +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +ALTER TABLE t1 DROP COLUMN c, FORCE; +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -137,21 +150,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 10000 CREATE INDEX idx_title ON t1(title); -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SELECT * FROM t1 WHERE title = 'a10'; -class id title -10 10 a10 -SELECT * FROM t1 WHERE title = 'a5000'; -class id title -5000 5000 a5000 -SELECT * FROM t1 WHERE title = 'a10000'; -class id title -10000 10000 a10000 -SELECT * FROM t1 WHERE title = 'a10010'; -class id title -DROP TABLE t1; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +RENAME TABLE t1 TO t0; # Test Blob CREATE TABLE t1( a INT PRIMARY KEY, @@ -168,9 +169,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -ALTER TABLE t1 DROP COLUMN c; -CHECK TABLE t1; +ALTER TABLE t1 DROP COLUMN c, FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +CHECK TABLE t0,t1; Table Op Msg_type Msg_text +test.t0 check status OK test.t1 check status OK SELECT CHAR_LENGTH(b) FROM t1; CHAR_LENGTH(b) @@ -179,14 +183,33 @@ CHAR_LENGTH(b) 40000 60000 DROP TABLE t1; +RENAME TABLE t0 to t1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1 WHERE title = 'a10'; +class id title +10 10 a10 +SELECT * FROM t1 WHERE title = 'a5000'; +class id title +5000 5000 a5000 +SELECT * FROM t1 WHERE title = 'a10000'; +class id title +10000 10000 a10000 +SELECT * FROM t1 WHERE title = 'a10010'; +class id title +DROP TABLE t1; CREATE TABLE t1( class INT, id INT, title VARCHAR(100) ) ENGINE=InnoDB ROW_FORMAT=COMPACT; -SET debug_dbug='+d,crash_commit_before'; +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; CREATE INDEX idx_title ON t1(title); -ERROR HY000: Lost connection to MySQL server during query +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; SELECT COUNT(*) FROM t1; COUNT(*) 10000 @@ -224,9 +247,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -SET debug_dbug='+d,crash_commit_before'; -ALTER TABLE t1 DROP COLUMN c; -ERROR HY000: Lost connection to MySQL server during query +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +ALTER TABLE t1 DROP COLUMN c, FORCE; +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -257,21 +283,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 10000 CREATE INDEX idx_title ON t1(title); -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SELECT * FROM t1 WHERE title = 'a10'; -class id title -10 10 a10 -SELECT * FROM t1 WHERE title = 'a5000'; -class id title -5000 5000 a5000 -SELECT * FROM t1 WHERE title = 'a10000'; -class id title -10000 10000 a10000 -SELECT * FROM t1 WHERE title = 'a10010'; -class id title -DROP TABLE t1; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +RENAME TABLE t1 TO t0; # Test Blob CREATE TABLE t1( a INT PRIMARY KEY, @@ -288,9 +302,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -ALTER TABLE t1 DROP COLUMN c; -CHECK TABLE t1; +ALTER TABLE t1 DROP COLUMN c, FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +CHECK TABLE t0,t1; Table Op Msg_type Msg_text +test.t0 check status OK test.t1 check status OK SELECT CHAR_LENGTH(b) FROM t1; CHAR_LENGTH(b) @@ -299,14 +316,33 @@ CHAR_LENGTH(b) 40000 60000 DROP TABLE t1; +RENAME TABLE t0 to t1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1 WHERE title = 'a10'; +class id title +10 10 a10 +SELECT * FROM t1 WHERE title = 'a5000'; +class id title +5000 5000 a5000 +SELECT * FROM t1 WHERE title = 'a10000'; +class id title +10000 10000 a10000 +SELECT * FROM t1 WHERE title = 'a10010'; +class id title +DROP TABLE t1; CREATE TABLE t1( class INT, id INT, title VARCHAR(100) ) ENGINE=InnoDB ROW_FORMAT=DYNAMIC; -SET debug_dbug='+d,crash_commit_before'; +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; CREATE INDEX idx_title ON t1(title); -ERROR HY000: Lost connection to MySQL server during query +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; SELECT COUNT(*) FROM t1; COUNT(*) 10000 @@ -344,9 +380,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -SET debug_dbug='+d,crash_commit_before'; -ALTER TABLE t1 DROP COLUMN c; -ERROR HY000: Lost connection to MySQL server during query +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +ALTER TABLE t1 DROP COLUMN c, FORCE; +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -378,21 +417,9 @@ SELECT COUNT(*) FROM t1; COUNT(*) 10000 CREATE INDEX idx_title ON t1(title); -CHECK TABLE t1; -Table Op Msg_type Msg_text -test.t1 check status OK -SELECT * FROM t1 WHERE title = 'a10'; -class id title -10 10 a10 -SELECT * FROM t1 WHERE title = 'a5000'; -class id title -5000 5000 a5000 -SELECT * FROM t1 WHERE title = 'a10000'; -class id title -10000 10000 a10000 -SELECT * FROM t1 WHERE title = 'a10010'; -class id title -DROP TABLE t1; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +RENAME TABLE t1 TO t0; # Test Blob SET GLOBAL innodb_file_per_table=1; CREATE TABLE t1( @@ -410,9 +437,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -ALTER TABLE t1 DROP COLUMN c; -CHECK TABLE t1; +ALTER TABLE t1 DROP COLUMN c, FORCE; +affected rows: 0 +info: Records: 0 Duplicates: 0 Warnings: 0 +CHECK TABLE t0,t1; Table Op Msg_type Msg_text +test.t0 check status OK test.t1 check status OK SELECT CHAR_LENGTH(b) FROM t1; CHAR_LENGTH(b) @@ -421,15 +451,34 @@ CHAR_LENGTH(b) 40000 60000 DROP TABLE t1; +RENAME TABLE t0 to t1; +CHECK TABLE t1; +Table Op Msg_type Msg_text +test.t1 check status OK +SELECT * FROM t1 WHERE title = 'a10'; +class id title +10 10 a10 +SELECT * FROM t1 WHERE title = 'a5000'; +class id title +5000 5000 a5000 +SELECT * FROM t1 WHERE title = 'a10000'; +class id title +10000 10000 a10000 +SELECT * FROM t1 WHERE title = 'a10010'; +class id title +DROP TABLE t1; SET GLOBAL innodb_file_per_table=1; CREATE TABLE t1( class INT, id INT, title VARCHAR(100) ) ENGINE=InnoDB ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=4; -SET debug_dbug='+d,crash_commit_before'; +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; CREATE INDEX idx_title ON t1(title); -ERROR HY000: Lost connection to MySQL server during query +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; SELECT COUNT(*) FROM t1; COUNT(*) 10000 @@ -468,9 +517,12 @@ CHAR_LENGTH(b) 20000 40000 60000 -SET debug_dbug='+d,crash_commit_before'; -ALTER TABLE t1 DROP COLUMN c; -ERROR HY000: Lost connection to MySQL server during query +connect hang,localhost,root; +SET DEBUG_SYNC='alter_table_inplace_trans_commit SIGNAL hung WAIT_FOR ever'; +ALTER TABLE t1 DROP COLUMN c, FORCE; +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +disconnect hang; CHECK TABLE t1; Table Op Msg_type Msg_text test.t1 check status OK @@ -481,5 +533,4 @@ CHAR_LENGTH(b) 40000 60000 DROP TABLE t1; -SET GLOBAL innodb_file_per_table=default; DROP PROCEDURE populate_t1; diff --git a/mysql-test/suite/innodb/t/alter_copy.test b/mysql-test/suite/innodb/t/alter_copy.test index 0dce61994b5..b7ab05a061a 100644 --- a/mysql-test/suite/innodb/t/alter_copy.test +++ b/mysql-test/suite/innodb/t/alter_copy.test @@ -37,11 +37,11 @@ SELECT * FROM t1 WHERE MATCH(b,c) AGAINST ('column'); SHOW CREATE TABLE t1; ALTER TABLE t1 FORCE, ALGORITHM=COPY; -# crash right after the last write_row(), before the first commit of ALTER TABLE ---source include/expect_crash.inc +# kill right after the last write_row(), before the first commit of ALTER TABLE +connect (hang,localhost,root); -SET DEBUG_DBUG='+d,crash_commit_before'; ---error 2013 +SET DEBUG_SYNC='alter_table_copy_trans_commit SIGNAL hung WAIT_FOR ever'; +send # create 32 secondary indexes ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX(b,a,d,c), ADD INDEX(b,d,a,c),ADD INDEX(b,d,c,a),ADD INDEX(a,b,c,d),ADD INDEX(a,b,d,c), @@ -53,8 +53,13 @@ ALTER TABLE t ADD INDEX(b,c,d,a),ADD INDEX(b,c,a,d),ADD INDEX(b,a,c,d),ADD INDEX ADD INDEX(a,b,d), ADD INDEX(a,d,b), ADD INDEX(b,c,d), ADD INDEX(b,d,c), ALGORITHM=COPY; +connection default; +SET DEBUG_SYNC='now WAIT_FOR hung'; +let $shutdown_timeout=0; --let $restart_parameters= --innodb-force-recovery=3 ---source include/start_mysqld.inc +--source include/restart_mysqld.inc +disconnect hang; +let $shutdown_timeout=; let $datadir=`select @@datadir`; --replace_regex /#sql-[0-9a-f_]*/#sql-temporary/ /FTS_[0-9a-f]*_[0-9a-f]*/FTS/ --list_files $datadir/test diff --git a/mysql-test/suite/innodb/t/auto_increment_dup.test b/mysql-test/suite/innodb/t/auto_increment_dup.test index aa399e5966d..9e54a6a8a66 100644 --- a/mysql-test/suite/innodb/t/auto_increment_dup.test +++ b/mysql-test/suite/innodb/t/auto_increment_dup.test @@ -8,8 +8,6 @@ --source include/have_debug_sync.inc --source include/innodb_binlog.inc -let $stmt= `SELECT @@GLOBAL.log_bin`; - set global transaction isolation level repeatable read; CREATE TABLE t1( @@ -84,13 +82,7 @@ SET DEBUG_SYNC='ha_write_row_end SIGNAL write_row_done WAIT_FOR continue'; --reap SET DEBUG_SYNC='execute_command_after_close_tables SIGNAL continue'; -if ($stmt) { ---error ER_LOCK_WAIT_TIMEOUT -INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; -} -if (!$stmt) { INSERT INTO t1(k) VALUES (2), (4), (5) ON DUPLICATE KEY UPDATE c='2'; -} --connection con1 --echo # diff --git a/mysql-test/suite/mariabackup/big_innodb_log.result b/mysql-test/suite/mariabackup/big_innodb_log.result new file mode 100644 index 00000000000..6577c0c9aae --- /dev/null +++ b/mysql-test/suite/mariabackup/big_innodb_log.result @@ -0,0 +1,30 @@ +# Kill the server +CREATE TABLE t(i INT) ENGINE InnoDB; +INSERT INTO t VALUES +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9), +(0), (1), (2), (3), (4), (5), (6), (7), (8), (9); +# xtrabackup backup, execute the following query after test.t is copied: +# BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END +SELECT count(*) FROM t WHERE i = 0; +count(*) +0 +# xtrabackup prepare +# shutdown server +# remove datadir +# xtrabackup move back +# restart server +SELECT count(*) FROM t WHERE i = 0; +count(*) +0 +Ok +Ok +DROP TABLE t; +# Kill the server diff --git a/mysql-test/suite/mariabackup/big_innodb_log.test b/mysql-test/suite/mariabackup/big_innodb_log.test new file mode 100644 index 00000000000..05dc3aa39c5 --- /dev/null +++ b/mysql-test/suite/mariabackup/big_innodb_log.test @@ -0,0 +1,87 @@ +# The general reason why innodb redo log file is limited by 512G is that +# log_block_convert_lsn_to_no() returns value limited by 1G. But there is no +# need to have unique log block numbers in log group. This test forces innodb +# to generate redo log files with non-unique log block numbers and tests +# recovery process with such numbers. +--source include/have_innodb.inc +--source include/have_debug.inc + +--let MYSQLD_DATADIR= `select @@datadir` +let $MYSQLD_BOOTSTRAP_CMD= $MYSQLD_BOOTSTRAP_CMD --datadir=$MYSQLD_DATADIR --debug-dbug=+d,innodb_small_log_block_no_limit; + +--source include/kill_mysqld.inc +--rmdir $MYSQLD_DATADIR +--mkdir $MYSQLD_DATADIR +--mkdir $MYSQLD_DATADIR/mysql +--mkdir $MYSQLD_DATADIR/test +--exec $MYSQLD_BOOTSTRAP_CMD < $MYSQL_BOOTSTRAP_SQL_FILE >> $MYSQLTEST_VARDIR/tmp/bootstrap.log 2>&1 +let $old_restart_parameters=$restart_parameters; +let $restart_parameters= $old_restart_parameters --debug-dbug=+d,innodb_small_log_block_no_limit; +--source include/start_mysqld.inc + +CREATE TABLE t(i INT) ENGINE InnoDB; +INSERT INTO t VALUES + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), + (0), (1), (2), (3), (4), (5), (6), (7), (8), (9); + +--let after_copy_test_t=BEGIN NOT ATOMIC INSERT INTO test.t SELECT * FROM test.t; UPDATE test.t SET i = 10 WHERE i = 0; DELETE FROM test.t WHERE i = 1; END + +--echo # xtrabackup backup, execute the following query after test.t is copied: +--echo # $after_copy_test_t +let $targetdir=$MYSQLTEST_VARDIR/tmp/backup; + +--disable_result_log +exec $XTRABACKUP --defaults-file=$MYSQLTEST_VARDIR/my.cnf --backup --parallel=10 --target-dir=$targetdir --dbug=+d,mariabackup_events,innodb_small_log_block_no_limit; +--enable_result_log + +--let $total_before=`SELECT count(*) FROM t` +SELECT count(*) FROM t WHERE i = 0; +--let $updated_before=`SELECT count(*) FROM t WHERE i = 10` + +echo # xtrabackup prepare; +--disable_result_log +exec $XTRABACKUP --prepare --target-dir=$targetdir --dbug=+d,innodb_small_log_block_no_limit; +--source include/restart_and_restore.inc +--enable_result_log + +--let $total_after=`SELECT count(*) FROM t` +SELECT count(*) FROM t WHERE i = 0; +--let $updated_after=`SELECT count(*) FROM t WHERE i = 10` + +if ($total_before == $total_after) { +--echo Ok +} +if ($total_before != $total_after) { +--echo Failed +} +if ($updated_before == $updated_after) { +--echo Ok +} +if ($updated_before != $updated_after) { +--echo Failed +} + +DROP TABLE t; +rmdir $targetdir; +--source include/kill_mysqld.inc +--rmdir $MYSQLD_DATADIR + +perl; +use lib "lib"; +use My::File::Path; +my $install_db_dir = ($ENV{MTR_PARALLEL} == 1) ? + "$ENV{'MYSQLTEST_VARDIR'}/install.db" : + "$ENV{'MYSQLTEST_VARDIR'}/../install.db"; +copytree($install_db_dir, $ENV{'MYSQLD_DATADIR'}); +EOF + +--let $restart_parameters= $old_restart_parameters +--source include/start_mysqld.inc diff --git a/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result new file mode 100644 index 00000000000..5cb2cd36d02 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_create_or_replace_fail.result @@ -0,0 +1,20 @@ +include/master-slave.inc +[connection master] +CREATE TEMPORARY TABLE t1 (a INT NOT NULL); +LOAD DATA INFILE 'x' INTO TABLE x; +ERROR 42S02: Table 'test.x' doesn't exist +CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x); +ERROR HY000: Cannot create temporary table with partitions +"************** DROP TEMPORARY TABLE Should be present in Binary log **************" +include/show_binlog_events.inc +Log_name Pos Event_type Server_id End_log_pos Info +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE TEMPORARY TABLE t1 (a INT NOT NULL) +master-bin.000001 # Gtid # # GTID #-#-# +master-bin.000001 # Query # # use `test`; CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x) +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (NULL); +connection slave; +connection master; +DROP TABLE t1; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result index 75a22b78a32..74648501fbe 100644 --- a/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result +++ b/mysql-test/suite/rpl/r/rpl_gtid_delete_domain.result @@ -41,7 +41,7 @@ START SLAVE; .. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' ...==== BEGIN include/wait_for_slave_param.inc [Slave_IO_Running] ==== ... con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Last_IO_Errno'] +Waiting until 'Slave_IO_Running' = 'Yes' [$slave_error_param='Last_IO_Errno'] [connection slave] ...==== END include/wait_for_slave_param.inc [Slave_IO_Running] ==== ... con='slave' warn='1' qlog='1' rlog='1' aborterr='1' @@ -52,7 +52,7 @@ Waiting until 'Slave_IO_Running' = 'Yes' [timeout='300', $slave_error_param='Las .. con='slave' warn='1' qlog='1' rlog='1' aborterr='1' ...==== BEGIN include/wait_for_slave_param.inc [Slave_SQL_Running] ==== ... con='slave' warn='1' qlog='1' rlog='1' aborterr='1' -Waiting until 'Slave_SQL_Running' = 'Yes' [timeout='300', $slave_error_param='1'] +Waiting until 'Slave_SQL_Running' = 'Yes' [$slave_error_param='1'] [connection slave] ...==== END include/wait_for_slave_param.inc [Slave_SQL_Running] ==== ... con='slave' warn='1' qlog='1' rlog='1' aborterr='1' diff --git a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result index 3cbb590b9a7..e935f8083c8 100644 --- a/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result +++ b/mysql-test/suite/rpl/r/rpl_known_bugs_detection.result @@ -1,31 +1,5 @@ call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); include/master-slave.inc -[connection master] -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); -CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, -UNIQUE(b)); -connection slave; -connection master; -INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; -SELECT * FROM t1; -a b -1 10 -2 2 -connection slave; -call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); -include/wait_for_slave_sql_error.inc [errno=1105] -Last_SQL_Error = 'Error 'master may suffer from http://bugs.mysql.com/bug.php?id=24432 so slave stops; check error log on slave for more info' on query. Default database: 'test'. Query: 'INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10'' -SELECT * FROM t1; -a b -stop slave; -include/wait_for_slave_to_stop.inc -reset slave; -connection master; -reset master; -drop table t1; -connection slave; -start slave; -include/wait_for_slave_to_start.inc connection master; CREATE TABLE t1 ( id bigint(20) unsigned NOT NULL auto_increment, diff --git a/mysql-test/suite/rpl/r/rpl_mdev_17614.result b/mysql-test/suite/rpl/r/rpl_mdev_17614.result new file mode 100644 index 00000000000..39057334926 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_mdev_17614.result @@ -0,0 +1,129 @@ +include/master-slave.inc +[connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT, +UNIQUE(b), c int) engine=innodb; +connection slave; +connection master; +INSERT INTO t1 VALUES (1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +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 +connection master1; +INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +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 +connection master; +COMMIT; +SELECT * FROM t1; +a b c +1 1 2 +2 2 3 +connection slave; +include/wait_for_slave_sql_error.inc [errno=1062] +Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)'' +#Different value from server +SELECT * FROM t1; +a b c +1 1 1 +2 2 3 +stop slave; +include/wait_for_slave_to_stop.inc +reset slave; +connection master; +reset master; +drop table t1; +connection slave; +start slave; +include/wait_for_slave_to_start.inc +connection master; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT, +UNIQUE(b), c int) engine=innodb; +connection slave; +connection master; +INSERT INTO t1 VALUES (default, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +connection master1; +INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +connection master; +COMMIT; +SELECT * FROM t1; +a b c +1 1 2 +3 2 3 +connection slave; +#same data as master +SELECT * FROM t1; +a b c +1 1 2 +3 2 3 +connection master; +drop table t1; +connection slave; +connection master; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, +UNIQUE(b), c int, d int ) engine=innodb; +connection slave; +connection master; +INSERT INTO t1 VALUES (1, 1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +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 +connection master1; +INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +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 +connection master; +COMMIT; +SELECT * FROM t1; +a b c d +1 1 1 1 +2 NULL 2 2 +3 NULL 2 3 +connection slave; +#same data as master +SELECT * FROM t1; +a b c d +1 1 1 1 +2 NULL 2 2 +3 NULL 2 3 +connection master; +drop table t1; +connection slave; +connection master; +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT, +UNIQUE(b), c int) engine=innodb; +connection slave; +connection master; +INSERT INTO t1 VALUES (1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +connection master1; +INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +connection master; +COMMIT; +SELECT * FROM t1; +a b c +1 1 2 +2 2 3 +connection slave; +include/wait_for_slave_sql_error.inc [errno=1062] +Last_SQL_Error = 'Error 'Duplicate entry '1' for key 'b'' on query. Default database: 'test'. Query: 'INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c)'' +#Different value from server +SELECT * FROM t1; +a b c +1 1 1 +2 2 3 +stop slave; +include/wait_for_slave_to_stop.inc +reset slave; +connection master; +reset master; +drop table t1; +connection slave; +start slave; +include/wait_for_slave_to_start.inc +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result new file mode 100644 index 00000000000..cd9ac1db9b1 --- /dev/null +++ b/mysql-test/suite/rpl/r/rpl_sync_with_innodb_thd_conc.result @@ -0,0 +1,18 @@ +include/master-slave.inc +[connection master] +connection slave; +SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; +SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; +SET GLOBAL innodb_thread_concurrency = 100; +connection master; +CREATE TABLE t(f INT) ENGINE=INNODB; +INSERT INTO t VALUES (10); +connection slave; +include/diff_tables.inc [master:t, slave:t] +"===== Clean up=======" +connection master; +DROP TABLE t; +connection slave; +SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; +SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; +include/rpl_end.inc diff --git a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result index ca790f5d148..0ce94ca63d0 100644 --- a/mysql-test/suite/rpl/r/rpl_unsafe_statements.result +++ b/mysql-test/suite/rpl/r/rpl_unsafe_statements.result @@ -1,5 +1,6 @@ include/master-slave.inc [connection master] +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); CREATE TABLE t1(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TABLE t2(id INT AUTO_INCREMENT, i INT, PRIMARY KEY (id)) ENGINE=INNODB; CREATE TRIGGER trig1 AFTER INSERT ON t1 @@ -49,9 +50,13 @@ connection master; DROP TABLE t1; CREATE TABLE t1(i INT, j INT, UNIQUE KEY(i), UNIQUE KEY(j)) ENGINE=INNODB; INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1; +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 START TRANSACTION; LOCK TABLES t1 WRITE; INSERT INTO t1 (i,j) VALUES (1,2) ON DUPLICATE KEY UPDATE j=j+1; +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 UNLOCK TABLES; COMMIT; connection slave; diff --git a/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test new file mode 100644 index 00000000000..e75f34b0b56 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_create_or_replace_fail.test @@ -0,0 +1,56 @@ +# ==== Purpose ==== +# +# Test verifies that failed CREATE OR REPLACE TEMPORARY TABLE statement which +# dropped the table but failed at a later stage of creation of temporary table +# is written to binarylog in row based replication. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Have mixed based replication mode. +# 1 - Create a temporary table. It will be replicated as mixed replication +# mode is in use. +# 2 - Execute an unsafe statement which will switch current statement +# binlog format to 'ROW'. i.e If binlog_format=MIXED, there are open +# temporary tables, and an unsafe statement is executed, then subsequent +# statements are logged in row format. +# 3 - Execute a CREATE OR REPLACE TEMPORARY TABLE statement which tries to +# create partitions on temporary table. Since it is not supported it will +# fail. +# 4 - Check the binary log output to ensure that the failed statement is +# written to the binary log. +# 5 - Slave should be up and running and in sync with master. +# +# ==== References ==== +# +# MDEV-18930: Failed CREATE OR REPLACE TEMPORARY not written into binary log +# makes data on master and slave diverge +# + +--source include/have_partition.inc +--source include/have_binlog_format_mixed.inc +--source include/master-slave.inc + +CREATE TEMPORARY TABLE t1 (a INT NOT NULL); + +# Execute an unsafe statement which switches replication mode internally from +# "STATEMENT" to "ROW". +--error ER_NO_SUCH_TABLE +LOAD DATA INFILE 'x' INTO TABLE x; + +--error ER_PARTITION_NO_TEMPORARY +CREATE OR REPLACE TEMPORARY TABLE t1 (x INT) PARTITION BY HASH(x); + +--echo "************** DROP TEMPORARY TABLE Should be present in Binary log **************" +--source include/show_binlog_events.inc + +CREATE TABLE t1 (b INT); +INSERT INTO t1 VALUES (NULL); +--sync_slave_with_master + +# Cleanup +--connection master +DROP TABLE t1; + +--source include/rpl_end.inc + diff --git a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test index ab263ece407..5ea056d5f14 100644 --- a/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test +++ b/mysql-test/suite/rpl/t/rpl_known_bugs_detection.test @@ -14,45 +14,6 @@ source include/have_binlog_checksum_off.inc; source include/master-slave.inc; -call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT."); - -# -# This is to test that slave properly detects if -# master may suffer from: -# BUG#24432 "INSERT... ON DUPLICATE KEY UPDATE skips auto_increment values" -# (i.e. on master, INSERT ON DUPLICATE KEY UPDATE is used and manipulates -# an auto_increment column, and is binlogged statement-based). -# - -# testcase with INSERT VALUES -CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY AUTO_INCREMENT, b INT, -UNIQUE(b)); -sync_slave_with_master; -connection master; -INSERT INTO t1(b) VALUES(1),(1),(2) ON DUPLICATE KEY UPDATE t1.b=10; -SELECT * FROM t1; -connection slave; - -# show the error message -#1105 = ER_UNKNOWN_ERROR ---let $slave_sql_errno= 1105 ---let $show_slave_sql_error= 1 -call mtr.add_suppression("Slave SQL.*suffer.*http:..bugs.mysql.com.bug.php.id=24432"); ---source include/wait_for_slave_sql_error.inc -# show that it was not replicated -SELECT * FROM t1; - -# restart replication for the next testcase -stop slave; ---source include/wait_for_slave_to_stop.inc -reset slave; -connection master; -reset master; -drop table t1; -connection slave; -start slave; ---source include/wait_for_slave_to_start.inc - # testcase with INSERT SELECT connection master; CREATE TABLE t1 ( diff --git a/mysql-test/suite/rpl/t/rpl_mdev_17614.test b/mysql-test/suite/rpl/t/rpl_mdev_17614.test new file mode 100644 index 00000000000..9b86c8c15b5 --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_mdev_17614.test @@ -0,0 +1,121 @@ +source include/have_debug.inc; +source include/have_innodb.inc; +-- source include/have_binlog_format_statement.inc +source include/master-slave.inc; +# MDEV-17614 +# INSERT on dup key update is replication unsafe +# There can be three case +# 1. 2 unique key, Replication is unsafe. +# 2. 2 unique key , with one auto increment key, Safe to replicate because Innodb will acquire gap lock +# 3. n no of unique keys (n>1) but insert is only in 1 unique key +# 4. 2 unique key , with one auto increment key(but user gives auto inc value), unsafe to replicate + +# Case 1 +call mtr.add_suppression("Unsafe statement written to the binary log using statement format"); +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY , b INT, +UNIQUE(b), c int) engine=innodb; +sync_slave_with_master; +connection master; +INSERT INTO t1 VALUES (1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); + --connection master1 + INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +--connection master +COMMIT; +SELECT * FROM t1; +--connection slave +# show the error message +--let $slave_sql_errno= 1062 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc +--echo #Different value from server +SELECT * FROM t1; + +# restart replication for the next testcase +stop slave; +--source include/wait_for_slave_to_stop.inc +reset slave; +connection master; +reset master; +drop table t1; +connection slave; +start slave; +--source include/wait_for_slave_to_start.inc +# Case 2 +--connection master +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT, +UNIQUE(b), c int) engine=innodb; +sync_slave_with_master; +connection master; +INSERT INTO t1 VALUES (default, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (default, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); + --connection master1 + INSERT INTO t1 VALUES(default, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +--connection master +COMMIT; +SELECT * FROM t1; +--sync_slave_with_master +--echo #same data as master +SELECT * FROM t1; + +connection master; +drop table t1; +--sync_slave_with_master + +# Case 3 +--connection master +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY, b INT, +UNIQUE(b), c int, d int ) engine=innodb; +sync_slave_with_master; +connection master; +INSERT INTO t1 VALUES (1, 1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, NULL, 2, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); + --connection master1 + INSERT INTO t1 VALUES(3, NULL, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +--connection master +COMMIT; +SELECT * FROM t1; +--sync_slave_with_master +--echo #same data as master +SELECT * FROM t1; +connection master; +drop table t1; +--sync_slave_with_master + +# Case 4 +--connection master +CREATE TABLE t1 (a INT NOT NULL PRIMARY KEY auto_increment, b INT, +UNIQUE(b), c int) engine=innodb; +sync_slave_with_master; +connection master; +INSERT INTO t1 VALUES (1, 1, 1); +BEGIN; +INSERT INTO t1 VALUES (2, 1, 2) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); + --connection master1 + INSERT INTO t1 VALUES(2, 2, 3) ON DUPLICATE KEY UPDATE b=VALUES(b), c=VALUES(c); +--connection master +COMMIT; +SELECT * FROM t1; +--connection slave +# show the error message +--let $slave_sql_errno= 1062 +--let $show_slave_sql_error= 1 +--source include/wait_for_slave_sql_error.inc +--echo #Different value from server +SELECT * FROM t1; + +# restart replication for the next testcase +stop slave; +--source include/wait_for_slave_to_stop.inc +reset slave; +connection master; +reset master; +drop table t1; +connection slave; +start slave; +--source include/wait_for_slave_to_start.inc + +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test new file mode 100644 index 00000000000..b4c2971d2fb --- /dev/null +++ b/mysql-test/suite/rpl/t/rpl_sync_with_innodb_thd_conc.test @@ -0,0 +1,41 @@ +# ==== Purpose ==== +# +# Test verifies that replication shouldn't hang when number of active threads +# on the slave server are less than the allowed innodb_thread_concurrency value. +# +# ==== Implementation ==== +# +# Steps: +# 0 - Have master slave replication setup with engine being Innodb. +# 1 - Configure innodb_thread_concurrency = 100. +# 2 - Do some DML on master and sync the slave with master. +# 3 - Ensure replication doesn't hang. +# +# ==== References ==== +# +# MDEV-20247: Replication hangs with "preparing" and never starts +# + +--source include/master-slave.inc +--source include/have_innodb.inc + +--connection slave +SET @old_innodb_thread_concurrency := @@innodb_thread_concurrency; +SET @old_innodb_thread_sleep_delay := @@innodb_thread_sleep_delay; +SET GLOBAL innodb_thread_concurrency = 100; + +--connection master +CREATE TABLE t(f INT) ENGINE=INNODB; +INSERT INTO t VALUES (10); +--sync_slave_with_master + +--let $diff_tables=master:t, slave:t +--source include/diff_tables.inc + +--echo "===== Clean up=======" +--connection master +DROP TABLE t; +--sync_slave_with_master +SET GLOBAL innodb_thread_concurrency = @old_innodb_thread_concurrency; +SET GLOBAL innodb_thread_sleep_delay = @old_innodb_thread_sleep_delay; +--source include/rpl_end.inc diff --git a/mysql-test/suite/rpl/t/rpl_unsafe_statements.test b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test index cbb4b54a220..aa0bd076398 100644 --- a/mysql-test/suite/rpl/t/rpl_unsafe_statements.test +++ b/mysql-test/suite/rpl/t/rpl_unsafe_statements.test @@ -24,7 +24,7 @@ --source include/have_innodb.inc --source include/have_binlog_format_mixed.inc --source include/master-slave.inc - +call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT"); # Case-1: BINLOG_STMT_UNSAFE_AUTOINC_COLUMNS # Statement is unsafe because it invokes a trigger or a # stored function that inserts into an AUTO_INCREMENT column. diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index b2a43e00742..591f31aa844 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1473,7 +1473,7 @@ VARIABLE_SCOPE GLOBAL VARIABLE_TYPE BIGINT UNSIGNED VARIABLE_COMMENT Size of each log file in a log group. NUMERIC_MIN_VALUE 1048576 -NUMERIC_MAX_VALUE 549755813888 +NUMERIC_MAX_VALUE 17592186044415 NUMERIC_BLOCK_SIZE 65536 ENUM_VALUE_LIST NULL READ_ONLY YES diff --git a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result index 2130723e5ff..2d8e9005f81 100644 --- a/mysql-test/suite/sys_vars/r/table_open_cache_basic.result +++ b/mysql-test/suite/sys_vars/r/table_open_cache_basic.result @@ -1,18 +1,9 @@ SET @start_value = @@global.table_open_cache ; -SELECT @start_value; -@start_value -421 -'#--------------------FN_DYNVARS_001_01------------------------#' -SET @@global.table_open_cache = 99; -SET @@global.table_open_cache = DeFAULT; -SELECT @@global.table_open_cache; -@@global.table_open_cache -2000 '#---------------------FN_DYNVARS_001_02-------------------------#' SET @@global.table_open_cache = Default; -SELECT @@global.table_open_cache = 400; -@@global.table_open_cache = 400 -0 +SELECT @@global.table_open_cache > 0; +@@global.table_open_cache > 0 +1 '#--------------------FN_DYNVARS_001_03------------------------#' SET @@global.table_open_cache = 8; Warnings: @@ -106,6 +97,3 @@ ERROR 42S02: Unknown table 'global' in field list SELECT table_open_cache = @@session.table_open_cache ; ERROR 42S22: Unknown column 'table_open_cache' in 'field list' SET @@global.table_open_cache = @start_value; -SELECT @@global.table_open_cache ; -@@global.table_open_cache -421 diff --git a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test index d2450e9586e..fc838d1a28b 100644 --- a/mysql-test/suite/sys_vars/t/table_open_cache_basic.test +++ b/mysql-test/suite/sys_vars/t/table_open_cache_basic.test @@ -4,8 +4,8 @@ # Scope: GLOBAL # # Access Type: Dynamic # # Data Type: numeric # -# Default Value: 400 # -# Range: 64-524288 # +# Default Value: 400 # +# Range: 64-524288 # # # # # # Creation Date: 2008-02-13 # @@ -35,18 +35,6 @@ ########################################################################## SET @start_value = @@global.table_open_cache ; -SELECT @start_value; - - ---echo '#--------------------FN_DYNVARS_001_01------------------------#' -######################################################################## -# Display the DEFAULT value of table_open_cache # -######################################################################## - -SET @@global.table_open_cache = 99; -SET @@global.table_open_cache = DeFAULT; -SELECT @@global.table_open_cache; - --echo '#---------------------FN_DYNVARS_001_02-------------------------#' ############################################### @@ -54,7 +42,7 @@ SELECT @@global.table_open_cache; ############################################### SET @@global.table_open_cache = Default; -SELECT @@global.table_open_cache = 400; +SELECT @@global.table_open_cache > 0; --echo '#--------------------FN_DYNVARS_001_03------------------------#' ######################################################################## @@ -163,10 +151,7 @@ SELECT table_open_cache = @@session.table_open_cache ; ############################## SET @@global.table_open_cache = @start_value; -SELECT @@global.table_open_cache ; - ################################################################## # END OF table_open_cache TESTS # ################################################################## - |