| 1 |
# |
| 2 |
# Auxiliary file which is used to test BUG#56118 |
| 3 |
# |
| 4 |
# Slave should apply all statements in the transaction before stop if any |
| 5 |
# temporary table is created or dropped. |
| 6 |
# |
| 7 |
# USEAGE: |
| 8 |
# --let $tmp_table_stm= a SQL statement |
| 9 |
# --source suite/rpl/include/rpl_stop_slave.test |
| 10 |
# |
| 11 |
|
| 12 |
if (!$tmp_table_stm) |
| 13 |
{ |
| 14 |
--echo \$tmp_table_stm is NULL |
| 15 |
--die $tmp_table_stm is NULL |
| 16 |
} |
| 17 |
|
| 18 |
connection master; |
| 19 |
BEGIN; |
| 20 |
DELETE FROM t1; |
| 21 |
eval $tmp_table_stm; |
| 22 |
INSERT INTO t1 VALUES (1); |
| 23 |
DROP TEMPORARY TABLE tt1; |
| 24 |
COMMIT; |
| 25 |
|
| 26 |
connection slave; |
| 27 |
|
| 28 |
# To check if slave SQL thread is applying INSERT statement |
| 29 |
let $show_statement= SHOW PROCESSLIST; |
| 30 |
let $field= Info; |
| 31 |
let $condition= LIKE 'INSERT%'; |
| 32 |
source include/wait_show_condition.inc; |
| 33 |
|
| 34 |
send STOP SLAVE SQL_THREAD; |
| 35 |
|
| 36 |
connection slave1; |
| 37 |
--echo # To resume slave SQL thread |
| 38 |
SET DEBUG_SYNC= 'now SIGNAL signal.continue'; |
| 39 |
SET DEBUG_SYNC= 'now WAIT_FOR signal.continued'; |
| 40 |
SET DEBUG_SYNC= 'RESET'; |
| 41 |
|
| 42 |
connection slave; |
| 43 |
reap; |
| 44 |
source include/wait_for_slave_sql_to_stop.inc; |
| 45 |
|
| 46 |
--echo # Slave should stop after the transaction has committed. |
| 47 |
--echo # So t1 on master is same to t1 on slave. |
| 48 |
--let $diff_tables= master:t1, slave:t1 |
| 49 |
--source include/diff_tables.inc |
| 50 |
|
| 51 |
connection slave; |
| 52 |
START SLAVE SQL_THREAD; |
| 53 |
source include/wait_for_slave_sql_to_start.inc; |
| 54 |
|
| 55 |
connection master; |
| 56 |
sync_slave_with_master; |