summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-03-29 17:20:01 +0100
committerunknown <knielsen@knielsen-hq.org>2013-03-29 17:20:01 +0100
commitd639aece97e621a71c0419673de561e963b79c2b (patch)
treec50038df7fa1e7c3f1b7f0cbb0ae505608f289b2 /mysql-test
parent0f266bc80ec0683ea9a784754a26c9d561b632b0 (diff)
downloadmariadb-git-d639aece97e621a71c0419673de561e963b79c2b.tar.gz
MDEV-26: Global transaction ID.
More fixes for race conditions in test cases.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_crash.result21
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_stop_start.result2
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_crash.test10
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_stop_start.test4
4 files changed, 33 insertions, 4 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_crash.result b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
index c52a94db47b..4cc9dc1806b 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result
@@ -6,6 +6,9 @@ INSERT INTO t1 VALUES (1, 0);
include/stop_slave.inc
CHANGE MASTER TO master_host = '127.0.0.1', master_port = MASTER_PORT,
MASTER_GTID_POS=AUTO;
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
include/start_slave.inc
@@ -23,6 +26,9 @@ SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
Log_name Pos Event_type Server_id End_log_pos Info
master-bin.000001 # Gtid_list # # []
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
include/start_slave.inc
SET gtid_domain_id= 1;
INSERT INTO t1 VALUES (1);
@@ -61,22 +67,37 @@ include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_write_rpl_slave_state";
START SLAVE;
INSERT INTO t1 VALUES (4);
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_before";
START SLAVE;
INSERT INTO t1 VALUES (5);
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,crash_commit_after";
START SLAVE;
INSERT INTO t1 VALUES (6);
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_before_flush_rli";
START SLAVE;
INSERT INTO t1 VALUES (7);
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
include/stop_slave.inc
SET GLOBAL debug_dbug="+d,inject_crash_after_flush_rli";
START SLAVE;
INSERT INTO t1 VALUES (8);
+SET sql_log_bin=0;
+FLUSH TABLES;
+SET sql_log_bin=1;
SELECT * FROM t1 ORDER BY a;
a
1
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
index 9d02ef0d5f9..ab48d5dd7f6 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_stop_start.result
@@ -7,7 +7,7 @@ Master_Log_File = 'master-bin.000001'
Using_Gtid = '0'
CHANGE MASTER TO master_gtid_pos=AUTO;
FLUSH LOGS;
-PURGE BINARY LOGS TO 'master-bin.000002';
+include/wait_for_purge.inc "master-bin.000002"
show binary logs;
Log_name File_size
master-bin.000002 #
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_crash.test b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
index 977fadae9e7..7c340118d45 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_crash.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_crash.test
@@ -20,6 +20,9 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT,
MASTER_GTID_POS=AUTO;
--connection server_1
+# Attempt to get tables closed and avoid "table ... is marked as crashed"
+# messages in error log.
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
INSERT INTO t1 VALUES (2,1);
INSERT INTO t1 VALUES (3,1);
@@ -81,6 +84,7 @@ RESET MASTER;
--replace_column 2 # 4 # 5 #
SHOW BINLOG EVENTS IN 'master-bin.000001' LIMIT 1,1;
CREATE TABLE t1 (a INT PRIMARY KEY) ENGINE=InnoDB;
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--connection server_2
--source include/start_slave.inc
@@ -97,7 +101,6 @@ FLUSH LOGS;
--replace_column 2 # 4 # 5 #
SHOW BINLOG EVENTS IN 'master-bin.000003' LIMIT 1,1;
-#--remove_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect
wait
EOF
@@ -150,6 +153,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 4 FROM t1
--source include/wait_condition.inc
@@ -175,6 +179,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 5 FROM t1
--source include/wait_condition.inc
@@ -200,6 +205,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 6 FROM t1
--source include/wait_condition.inc
@@ -225,6 +231,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 7 FROM t1
--source include/wait_condition.inc
@@ -250,6 +257,7 @@ EOF
--enable_reconnect
--source include/wait_until_connected_again.inc
+SET sql_log_bin=0; FLUSH TABLES; SET sql_log_bin=1;
--let $wait_condition= SELECT COUNT(*) = 8 FROM t1
--source include/wait_condition.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
index 08b8728330e..bb0c27e59ff 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_stop_start.test
@@ -32,8 +32,8 @@ EOF
--connection server_1
FLUSH LOGS;
---source include/wait_for_binlog_checkpoint.inc
-PURGE BINARY LOGS TO 'master-bin.000002';
+--let $purge_binlogs_to=master-bin.000002
+--source include/wait_for_purge.inc
--source include/show_binary_logs.inc
INSERT INTO t1 VALUES (2);
FLUSH LOGS;