summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-03-27 10:44:28 +0100
committerunknown <knielsen@knielsen-hq.org>2013-03-27 10:44:28 +0100
commite5b60f0add3a05ebe617d5d8ccef22f8e6a16d07 (patch)
tree3af02601cc1b3cb3bae548e534cb8c5584e853eb /mysql-test
parent20e021115fac345c8c6a9b6c4d6512e0f93f816a (diff)
downloadmariadb-git-e5b60f0add3a05ebe617d5d8ccef22f8e6a16d07.tar.gz
MDEV-26: Global transaction ID.
Fix bug that RESET SLAVE did not reset Using_Gtid back to 0.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/suite/rpl/r/rpl_gtid_startpos.result18
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_startpos.test29
2 files changed, 47 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
index 70af8eae6ef..a4b67ccfe67 100644
--- a/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
+++ b/mysql-test/suite/rpl/r/rpl_gtid_startpos.result
@@ -111,5 +111,23 @@ SELECT * FROM t1 ORDER BY a;
a
1
2
+*** Test that RESET SLAVE clears the Using_Gtid flag. ***
+include/stop_slave.inc
+RESET SLAVE;
+Using_Gtid = '0'
+START SLAVE;
+include/wait_for_slave_sql_error.inc [errno=1050]
+STOP SLAVE IO_THREAD;
+CHANGE MASTER TO MASTER_GTID_POS=AUTO;
+include/start_slave.inc
+INSERT INTO t1 VALUES(3);
+SELECT * FROM t1 ORDER BY a;
+a
+1
+2
+3
+SET SQL_LOG_BIN=0;
+call mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050");
+SET SQL_LOG_BIN=1;
DROP TABLE t1;
include/rpl_end.inc
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
index d2e2303a588..2e3cd306961 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
@@ -181,6 +181,35 @@ eval CHANGE MASTER TO master_gtid_pos='';
--sync_with_master
SELECT * FROM t1 ORDER BY a;
+--echo *** Test that RESET SLAVE clears the Using_Gtid flag. ***
+--source include/stop_slave.inc
+RESET SLAVE;
+--let $status_items= Using_Gtid
+--source include/show_slave_status.inc
+
+# Starting the slave now reverts to old-style position which defaults to
+# the first non-purged binlog file on the master.
+# This should give error due to table already existing.
+START SLAVE;
+--let $slave_sql_errno= 1050
+--source include/wait_for_slave_sql_error.inc
+
+# Going back to using GTID should fix things.
+STOP SLAVE IO_THREAD;
+CHANGE MASTER TO MASTER_GTID_POS=AUTO;
+--source include/start_slave.inc
+
+--connection server_1
+INSERT INTO t1 VALUES(3);
+
+--connection server_2
+--let $wait_condition= SELECT COUNT(*) = 3 FROM t1
+--source include/wait_condition.inc
+SELECT * FROM t1 ORDER BY a;
+SET SQL_LOG_BIN=0;
+call mtr.add_suppression("Slave: Table 't1' already exists Error_code: 1050");
+SET SQL_LOG_BIN=1;
+
# Clean up.
--connection server_1