# # Test that a MySQL slave can use CHANGE MASTER MASTER_AUTO_POSITION to begin replicating # from another Galera node # # The galera/galera_2node_master.cnf describes the setup of the nodes # # --source include/have_innodb.inc --source include/have_log_bin.inc --source include/galera_cluster.inc --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 --disable_query_log --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_1; --enable_query_log START SLAVE USER='root'; --connection node_1 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES(1); --connection node_2 INSERT INTO t1 VALUES(2); --connection node_3 STOP SLAVE; --disable_query_log --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_PORT=$NODE_MYPORT_2, MASTER_AUTO_POSITION=1; --enable_query_log START SLAVE USER='root'; --connection node_1 INSERT INTO t1 VALUES(3); --connection node_2 INSERT INTO t1 VALUES(4); --connection node_3 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 4 FROM t1; --source include/wait_condition.inc --connection node_1 DROP TABLE t1; --connection node_3 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; --source include/wait_condition.inc STOP SLAVE; RESET SLAVE ALL;