summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_stop_slave.test
diff options
context:
space:
mode:
authorunknown <Li-Bing.Song@sun.com>2010-10-16 22:20:35 +0800
committerunknown <Li-Bing.Song@sun.com>2010-10-16 22:20:35 +0800
commitc20cbe5b4af9fc4735fb5d4a6b15ddfcb20ae37d (patch)
tree2a64770661183d8337ae0e746f0b197e5bcac1e7 /mysql-test/suite/rpl/t/rpl_stop_slave.test
parent650e4c25db94273bdf2300ddb987294f0d4edd72 (diff)
parent211552ccee98e381a14dfaae754528d9f6ed0494 (diff)
downloadmariadb-git-c20cbe5b4af9fc4735fb5d4a6b15ddfcb20ae37d.tar.gz
Manual merge
Diffstat (limited to 'mysql-test/suite/rpl/t/rpl_stop_slave.test')
-rw-r--r--mysql-test/suite/rpl/t/rpl_stop_slave.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_stop_slave.test b/mysql-test/suite/rpl/t/rpl_stop_slave.test
new file mode 100644
index 00000000000..3950b59908a
--- /dev/null
+++ b/mysql-test/suite/rpl/t/rpl_stop_slave.test
@@ -0,0 +1,51 @@
+source include/master-slave.inc;
+source include/have_innodb.inc;
+source include/have_debug.inc;
+source include/have_debug_sync.inc;
+source include/have_binlog_format_mixed_or_statement.inc;
+
+--echo
+--echo # BUG#56118 STOP SLAVE does not wait till trx with CREATE TMP TABLE ends
+--echo #
+--echo # If a temporary table is created or dropped, the transaction should be
+--echo # regarded similarly that a non-transactional table is modified. So
+--echo # STOP SLAVE should wait until the transaction has finished.
+
+CREATE TABLE t1(c1 INT) ENGINE=InnoDB;
+CREATE TABLE t2(c1 INT) ENGINE=InnoDB;
+
+sync_slave_with_master;
+SET DEBUG_SYNC= 'RESET';
+source include/stop_slave.inc;
+
+--echo
+--echo # Suspend the INSERT statement in current transaction on SQL thread.
+--echo # It guarantees that SQL thread is applying the transaction when
+--echo # STOP SLAVE command launchs.
+let $debug_save= `SELECT @@GLOBAL.debug`;
+SET GLOBAL debug= 'd,after_mysql_insert';
+source include/start_slave.inc;
+
+--echo
+--echo # CREATE TEMPORARY TABLE with InnoDB engine
+--echo # -----------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+--echo
+--echo # CREATE TEMPORARY TABLE ... SELECT with InnoDB engine
+--echo # ----------------------------------------------------
+let $tmp_table_stm= CREATE TEMPORARY TABLE tt1(c1 INT) ENGINE = InnoDB
+ SELECT c1 FROM t2;
+source extra/rpl_tests/rpl_stop_slave.test;
+
+# Don't need to verify 'CREATE TEMPORARY TABLE' with MyIASM engine, as it
+# never is binlogged into a transaction since 5.5.
+
+--echo
+--echo # Test end
+SET GLOBAL debug= '$debug_save';
+
+connection master;
+DROP TABLE t1, t2;
+source include/master-slave-end.inc;