1############################################################# 2# Author: JBM 3# Date: 2006-02-23 4# Purpose: To reuse through out test and make maint easier 5############################################################# 6connection master; 7--echo "--- Insert into t1 --" as ""; 8 9--disable_query_log 10INSERT INTO t1 VALUES(42,1,'Testing MySQL databases is a cool ', 11 'Must make it bug free for the customer', 12 654321.4321,15.21,0,1965,"1905-11-14"); 13INSERT INTO t1 VALUES(2,1,'Testing MySQL databases is a cool ', 14 'Must make it bug free for the customer', 15 654321.4321,15.21,0,1965,"1965-11-14"); 16INSERT INTO t1 VALUES(4,1,'Testing MySQL databases is a cool ', 17 'Must make it bug free for the customer', 18 654321.4321,15.21,0,1965,"1985-11-14"); 19INSERT INTO t1 VALUES(142,1,'Testing MySQL databases is a cool ', 20 'Must make it bug free for the customer', 21 654321.4321,15.21,0,1965,"1995-11-14"); 22INSERT INTO t1 VALUES(412,1,'Testing MySQL databases is a cool ', 23 'Must make it bug free for the customer', 24 654321.4321,15.21,0,1965,"2005-11-14"); 25--enable_query_log 26 27--echo --- Select from t1 on master --- 28select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; 29 30sync_slave_with_master; 31--echo --- Select from t1 on slave --- 32select id,hex(b1),vc,bc,d,f,total,y,t from t1 order by id; 33 34connection master; 35 36--echo --- Update t1 on master -- 37UPDATE t1 SET b1 = 0, t="2006-02-22" WHERE id = 412; 38 39--echo --- Check the update on master --- 40SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; 41 42# Must give injector thread a little time to get update 43# into the binlog other wise we will miss the update. 44 45sync_slave_with_master; 46--echo --- Check Update on slave --- 47SELECT id,hex(b1),vc,bc,d,f,total,y,t FROM t1 WHERE id = 412; 48 49connection master; 50--echo --- Remove a record from t1 on master --- 51DELETE FROM t1 WHERE id = 42; 52 53--echo --- Show current count on master for t1 --- 54SELECT COUNT(*) FROM t1; 55 56sync_slave_with_master; 57--echo --- Show current count on slave for t1 --- 58SELECT COUNT(*) FROM t1; 59 60connection master; 61DELETE FROM t1; 62