mySQL 5.0.11 sources for tomato
[tomato.git] / release / src / router / mysql / mysql-test / extra / rpl_tests / rpl_stop_slave.test
blobec6f297caecdf323aa8a1a50a9ba326551f68275
2 # Auxiliary file which is used to test BUG#56118 
4 # Slave should apply all statements in the transaction before stop if any
5 # temporary table is created or dropped.
7 # USEAGE: 
8 # --let $tmp_table_stm= a SQL statement 
9 # --source extra/rpl_tests/rpl_stop_slave.test
12 if (`SELECT "$tmp_table_stm" = ''`)
14   --echo \$tmp_table_stm is NULL
15   --die $tmp_table_stm is NULL
18 --echo
19 --echo [ On Master ]
20 connection master;
21 BEGIN;
22 DELETE FROM t1;
23 eval $tmp_table_stm;
24 INSERT INTO t1 VALUES (1);
25 DROP TEMPORARY TABLE tt1;
26 COMMIT;
28 --echo
29 --echo [ On Slave ]
30 connection slave;
32 # To check if slave SQL thread is applying INSERT statement
33 let $show_statement= SHOW PROCESSLIST;
34 let $field= Info;
35 let $condition= LIKE 'INSERT%';
36 source include/wait_show_condition.inc;
38 send STOP SLAVE SQL_THREAD;
40 --echo
41 --echo [ On Slave1 ]
42 connection slave1;
43 --echo # To resume slave SQL thread
44 SET DEBUG_SYNC= 'now SIGNAL signal.continue';
45 SET DEBUG_SYNC= 'RESET';
47 --echo
48 --echo [ On Slave ]
49 connection slave;
50 reap;
51 source include/wait_for_slave_sql_to_stop.inc;
53 --echo # Slave should stop after the transaction has committed.
54 --echo # So t1 on master is same to t1 on slave.
55 let diff_tables= master:t1, slave:t1;
56 source include/diff_tables.inc;
58 connection slave;
59 START SLAVE SQL_THREAD;
60 source include/wait_for_slave_sql_to_start.inc;