Commit e5b60f0a authored by unknown's avatar unknown

MDEV-26: Global transaction ID.

Fix bug that RESET SLAVE did not reset Using_Gtid back to 0.
parent 20e02111
......@@ -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
......@@ -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
......
......@@ -143,6 +143,7 @@ void init_master_log_pos(Master_info* mi)
mi->master_log_name[0] = 0;
mi->master_log_pos = BIN_LOG_HEADER_SIZE; // skip magic number
mi->using_gtid= false;
/* Intentionally init ssl_verify_server_cert to 0, no option available */
mi->ssl_verify_server_cert= 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment