# # Test Galera as a slave to a MySQL master # # The galera/galera_2node_slave.cnf describes the setup of the nodes # --source include/have_innodb.inc --source include/galera_cluster.inc # As node #3 is not a Galera node, and galera_cluster.inc does not open connetion to it # we open the node_3 connection here --connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3 --connection node_2 --disable_query_log --eval CHANGE MASTER TO MASTER_HOST='127.0.0.1', MASTER_USER='root', MASTER_PORT=$NODE_MYPORT_3; --enable_query_log START SLAVE; --connection node_3 CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; INSERT INTO t1 VALUES(1); --connection node_2 --let $wait_condition = SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; --source include/wait_condition.inc --let $wait_condition = SELECT COUNT(*) = 1 FROM t1; --source include/wait_condition.inc INSERT INTO t1 VALUES (2); --connection node_1 SELECT COUNT(*) = 2 FROM t1; INSERT INTO t1 VALUES (3); --connection node_2 SELECT COUNT(*) = 3 FROM t1; --connection node_3 SET @@session.binlog_alter_two_phase = 1; ALTER TABLE t1 ADD COLUMN f2 INT; INSERT INTO t1 VALUES (4,1); --connection node_1 --let $count = 4 --let $table = t1 --source include/wait_until_rows_count.inc --connection node_2 --let $count = 4 --let $table = t1 --source include/wait_until_rows_count.inc --connection node_3 DROP TABLE t1; --connection node_2 --let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'; --source include/wait_condition.inc STOP SLAVE; RESET SLAVE ALL; --connection node_3 RESET MASTER;