summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t
diff options
context:
space:
mode:
authorunknown <knielsen@knielsen-hq.org>2013-04-04 17:38:10 +0200
committerunknown <knielsen@knielsen-hq.org>2013-04-04 17:38:10 +0200
commitc2cbc9cee6a3f8f745501ee2f5fcfd4586f53bbd (patch)
treeb779d3a554d9f69556e1a805b46bf27261a5c451 /mysql-test/suite/rpl/t
parentbdf6367d0e019703b48c62b1ae5728e48ba0eba7 (diff)
downloadmariadb-git-c2cbc9cee6a3f8f745501ee2f5fcfd4586f53bbd.tar.gz
MDEV-26: Global transaction ID.
Move combining slave and gtid binlog state into a separate function. Make SHOW ALL SLAVES STATUS use the same function, so it shows the same value used by slave connect. Add a test case.
Diffstat (limited to 'mysql-test/suite/rpl/t')
-rw-r--r--mysql-test/suite/rpl/t/rpl_gtid_startpos.test40
1 files changed, 40 insertions, 0 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
index e2624051b69..a5200de46ec 100644
--- a/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
+++ b/mysql-test/suite/rpl/t/rpl_gtid_startpos.test
@@ -240,6 +240,46 @@ eval CHANGE MASTER TO master_host = '127.0.0.1', master_port = $MASTER_MYPORT;
SELECT * FROM t1 ORDER BY a;
+--echo *** Test modifying binlog on slave and the effect on GTID state. ***
+
+--connection server_2
+--source include/stop_slave.inc
+RESET MASTER;
+CHANGE MASTER TO master_gtid_pos='';
+
+--connection server_1
+RESET MASTER;
+TRUNCATE TABLE t1;
+INSERT INTO t1 VALUES (10); # Will be GTID 0-1-2
+--save_master_pos
+
+--connection server_2
+--source include/start_slave.inc
+--sync_with_master
+
+SELECT * FROM t1;
+--let $value= query_get_value(SHOW SLAVE STATUS, "Using_Gtid", 1)
+eval SELECT '$value' AS Using_Gtid;
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
+eval SELECT '$value' AS Gtid_Pos;
+
+UPDATE t1 SET a=9 WHERE a=10;
+UPDATE t1 SET a=10 WHERE a=9;
+
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
+eval SELECT '$value' AS Gtid_Pos;
+
+--source include/stop_slave.inc
+--error ER_MASTER_GTID_POS_CONFLICTS_WITH_BINLOG
+CHANGE MASTER TO master_gtid_pos= '0-1-2';
+RESET MASTER;
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
+eval SELECT '$value' AS Gtid_Pos;
+CHANGE MASTER TO master_gtid_pos= '0-1-2';
+--source include/start_slave.inc
+--let $value= query_get_value(SHOW ALL SLAVES STATUS, "Gtid_Pos", 1)
+eval SELECT '$value' AS Gtid_Pos;
+
# Clean up.
--connection server_1
DROP TABLE t1;