You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
1.3 KiB

  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 extra/rpl_tests/rpl_stop_slave.test
  10. #
  11. if (`SELECT "$tmp_table_stm" = ''`)
  12. {
  13. --echo \$tmp_table_stm is NULL
  14. --die $tmp_table_stm is NULL
  15. }
  16. --echo
  17. --echo [ On Master ]
  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. --echo
  26. --echo [ On Slave ]
  27. connection slave;
  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. send STOP SLAVE SQL_THREAD;
  34. --echo
  35. --echo [ On Slave1 ]
  36. connection slave1;
  37. --echo # To resume slave SQL thread
  38. SET DEBUG_SYNC= 'now SIGNAL signal.continue';
  39. SET DEBUG_SYNC= 'RESET';
  40. --echo
  41. --echo [ On Slave ]
  42. connection slave;
  43. reap;
  44. source include/wait_for_slave_sql_to_stop.inc;
  45. --echo # Slave should stop after the transaction has committed.
  46. --echo # So t1 on master is same to t1 on slave.
  47. let diff_table_1=master:test.t1;
  48. let diff_table_2=slave:test.t1;
  49. source include/diff_tables.inc;
  50. connection slave;
  51. START SLAVE SQL_THREAD;
  52. source include/wait_for_slave_sql_to_start.inc;