Added master-slave synchronization to make sure truncate happen before slave...

Added master-slave synchronization to make sure truncate happen before slave manipulations on every platform
parent 00ba129e
...@@ -206,21 +206,27 @@ SET SQL_LOG_BIN=0; ...@@ -206,21 +206,27 @@ SET SQL_LOG_BIN=0;
INSERT INTO t1_nodef VALUES (1,2); INSERT INTO t1_nodef VALUES (1,2);
INSERT INTO t1_nodef VALUES (2,4); INSERT INTO t1_nodef VALUES (2,4);
SET SQL_LOG_BIN=1; SET SQL_LOG_BIN=1;
sync_slave_with_master;
--echo **** On Slave **** --echo **** On Slave ****
connection slave; connection slave;
INSERT INTO t1_nodef VALUES (1,2,3); INSERT INTO t1_nodef VALUES (1,2,3);
INSERT INTO t1_nodef VALUES (2,4,6); INSERT INTO t1_nodef VALUES (2,4,6);
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
UPDATE t1_nodef SET b=2*b WHERE a=1; UPDATE t1_nodef SET b=2*b WHERE a=1;
SELECT * FROM t1_nodef; SELECT * FROM t1_nodef;
--echo **** On Slave **** --echo **** On Slave ****
sync_slave_with_master; sync_slave_with_master;
SELECT * FROM t1_nodef; SELECT * FROM t1_nodef;
--echo **** On Master **** --echo **** On Master ****
connection master; connection master;
DELETE FROM t1_nodef WHERE a=2; DELETE FROM t1_nodef WHERE a=2;
SELECT * FROM t1_nodef; SELECT * FROM t1_nodef;
--echo **** On Slave **** --echo **** On Slave ****
sync_slave_with_master; sync_slave_with_master;
SELECT * FROM t1_nodef; SELECT * FROM t1_nodef;
......
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