mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / suite / engines / funcs / t / rpl_change_master.test
blobc031464c95ee97cd666f6785f6e05bd79069121c
1 # Verify that after CHANGE MASTER, replication (I/O thread and SQL
2 # thread) restart from where SQL thread left, not from where
3 # I/O thread left (some old bug fixed in 4.0.17)
5 source include/master-slave.inc;
7 connection master;
8 # Make SQL slave thread advance a bit
9 create table t1(n int);
10 sync_slave_with_master;
11 select * from t1;
12 # Now stop it and make I/O slave thread be ahead
13 stop slave sql_thread;
14 connection master;
15 insert into t1 values(1);
16 insert into t1 values(2);
17 save_master_pos;
18 connection slave;
19 --real_sleep 3 # wait for I/O thread to have read updates
20 stop slave;
21 --replace_result $MASTER_MYPORT MASTER_MYPORT
22 --replace_column 1 # 7 # 8 # 9 # 23 # 33 #
23 show slave status;
24 change master to master_user='root';
25 --replace_result $MASTER_MYPORT MASTER_MYPORT
26 --replace_column 1 # 7 # 8 # 9 # 23 # 33 #
27 show slave status;
28 start slave;
29 sync_with_master;
30 select * from t1;
31 connection master;
32 drop table t1;
33 save_master_pos;
34 connection slave;
35 sync_with_master;
37 # End of 4.1 tests