| 1 |
# |
| 2 |
# Invoked by binlog_truncate_multi_engine.test |
| 3 |
# Parameters: |
| 4 |
# $debug_sync_action describes debug-sync actions |
| 5 |
# $kill_server 1 when to crash, 0 for regular restart |
| 6 |
# $restart_parameters the caller may simulate partial commit at recovery |
| 7 |
# $test_outcome summary of extected results |
| 8 |
# $MYSQLD_DATADIR |
| 9 |
|
| 10 |
--echo # |
| 11 |
--echo # |
| 12 |
--echo # Case $case : $description |
| 13 |
--echo # |
| 14 |
RESET MASTER; |
| 15 |
FLUSH LOGS; |
| 16 |
SET GLOBAL max_binlog_size= 4096; |
| 17 |
|
| 18 |
connect(con1,localhost,root,,); |
| 19 |
--echo List of binary logs before rotation |
| 20 |
--source include/show_binary_logs.inc |
| 21 |
INSERT INTO t1 VALUES (1, REPEAT("x", 1)); |
| 22 |
INSERT INTO t2 VALUES (1, REPEAT("x", 1)); |
| 23 |
--let $is_case_B=`SELECT $case = "B"` |
| 24 |
|
| 25 |
if ($is_case_B) |
| 26 |
{ |
| 27 |
--write_file $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 28 |
wait-binlog_truncate_multi_engine.test |
| 29 |
EOF |
| 30 |
|
| 31 |
SET GLOBAL debug_dbug="d,enable_log_write_upto_crash"; |
| 32 |
} |
| 33 |
BEGIN; |
| 34 |
INSERT INTO t2 VALUES (2, REPEAT("x", 4100)); |
| 35 |
INSERT INTO t1 VALUES (2, REPEAT("x", 4100)); |
| 36 |
|
| 37 |
if (`SELECT $debug_sync_action != ""`) |
| 38 |
{ |
| 39 |
--eval SET DEBUG_SYNC= $debug_sync_action |
| 40 |
} |
| 41 |
send COMMIT; |
| 42 |
|
| 43 |
--connection default |
| 44 |
if ($is_case_B) |
| 45 |
{ |
| 46 |
--source include/wait_until_disconnected.inc |
| 47 |
--source include/start_mysqld.inc |
| 48 |
} |
| 49 |
if (!$is_case_B) |
| 50 |
{ |
| 51 |
SET DEBUG_SYNC= "now WAIT_FOR con1_ready"; |
| 52 |
--echo List of binary logs after rotation |
| 53 |
--source include/show_binary_logs.inc |
| 54 |
|
| 55 |
--echo # restart the server with $restart_parameters |
| 56 |
--echo # the server is restarted |
| 57 |
--source include/restart_mysqld.inc |
| 58 |
} |
| 59 |
|
| 60 |
--connection default |
| 61 |
--echo # |
| 62 |
--echo # *** Summary: $test_outcome: |
| 63 |
--echo # |
| 64 |
SELECT COUNT(*) FROM t1; |
| 65 |
SELECT COUNT(*) FROM t2; |
| 66 |
SELECT @@GLOBAL.gtid_binlog_state; |
| 67 |
SELECT @@GLOBAL.gtid_binlog_pos; |
| 68 |
--echo List of binary logs at the end of the tests |
| 69 |
--source include/show_binary_logs.inc |
| 70 |
--echo # *** |
| 71 |
# cleanup |
| 72 |
DELETE FROM t1; |
| 73 |
DELETE FROM t2; |
| 74 |
--disconnect con1 |
| 75 |
--echo # |