summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMats Kindahl <mats@mysql.com>2008-07-09 14:34:00 +0200
committerMats Kindahl <mats@mysql.com>2008-07-09 14:34:00 +0200
commitd034ae598f8572f702e5b0bba8ffe9906235151a (patch)
treec4c17eba1e1749824796f27ccca97851bfb8b615
parent9e2abfacf2fb8e1a0cccd565653c9a64dc129c03 (diff)
downloadmariadb-git-d034ae598f8572f702e5b0bba8ffe9906235151a.tar.gz
Ensuring that master and slave both issue a RESET MASTER and RESET SLAVE
when resetting replication tests. If not, circular replication setups will leave cruft in the slaves binary log. mysql-test/include/master-slave-reset.inc: Adding RESET MASTER on slave and RESET SLAVE on master. In order to avoid having to re-generate all the replication test result files, I disable the query log for the added statements. mysql-test/suite/rpl/t/rpl_flushlog_loop.test: Adding code to clean up after test. Disabling query log for the cleanup code.
-rw-r--r--mysql-test/include/master-slave-reset.inc17
-rw-r--r--mysql-test/suite/rpl/t/rpl_flushlog_loop.test6
2 files changed, 21 insertions, 2 deletions
diff --git a/mysql-test/include/master-slave-reset.inc b/mysql-test/include/master-slave-reset.inc
index 1363fab236a..57fcc8f00cc 100644
--- a/mysql-test/include/master-slave-reset.inc
+++ b/mysql-test/include/master-slave-reset.inc
@@ -1,6 +1,13 @@
+# Reset the master and the slave to start fresh.
+#
+# It is necessary to execute RESET MASTER and RESET SLAVE on both
+# master and slave since the replication setup might be circular.
+#
+# Since we expect STOP SLAVE to produce a warning as the slave is
+# stopped (the server was started with skip-slave-start), we disable
+# warnings when doing STOP SLAVE.
+
connection slave;
-#we expect STOP SLAVE to produce a warning as the slave is stopped
-#(the server was started with skip-slave-start)
--disable_warnings
stop slave;
source include/wait_for_slave_to_stop.inc;
@@ -13,7 +20,13 @@ use test;
drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t9;
--enable_warnings
reset master;
+--disable_query_log
+reset slave;
+--enable_query_log
connection slave;
+--disable_query_log
+reset master;
+--enable_query_log
reset slave;
# Clean up old test tables
--disable_warnings
diff --git a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
index 5aed5753129..f37df68ac3b 100644
--- a/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
+++ b/mysql-test/suite/rpl/t/rpl_flushlog_loop.test
@@ -74,3 +74,9 @@ source include/wait_for_slave_param.inc;
--replace_result $SLAVE_MYPORT SLAVE_PORT $slave_param_value POSITION
--replace_column 1 # 8 # 9 # 16 # 23 # 33 # 34 # 35 #
--query_vertical SHOW SLAVE STATUS
+
+--disable_query_log
+connection master;
+DROP TABLE t1;
+sync_slave_with_master;
+--enable_query_log