| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Used by test `binlog_gtid.binlog_gtid_recovery_errors`, it cleans up |
| 4 |
# after a binlog recovery error scenario, by: |
| 5 |
# 1. Reinstating the correct binary log file. |
| 6 |
# 2. Starting the crashed server. |
| 7 |
# 3. Cleaning up server context. |
| 8 |
# |
| 9 |
# ==== Parameters ==== |
| 10 |
# |
| 11 |
# $recovery_scenario |
| 12 |
# The recovery scenario being executed. |
| 13 |
# |
| 14 |
# $end_scenario_stmt |
| 15 |
# The statement to execute after restarting the server and before |
| 16 |
# cleaning the sever context. |
| 17 |
# |
| 18 |
# $target_binlog_file |
| 19 |
# The active binlog file name, as instantiated in |
| 20 |
# `extra/binlog_tests/recovery/kill_copy_malformed_restart.inc`. |
| 21 |
# |
| 22 |
# $target_binlog_file_bak |
| 23 |
# Backup of the binlog file before overwriting with a corrupted one, as |
| 24 |
# instantiated in |
| 25 |
# `extra/binlog_tests/recovery/kill_copy_malformed_restart.inc`. |
| 26 |
# |
| 27 |
# ==== References ==== |
| 28 |
# |
| 29 |
# WL#11300: Crash-safe XA + binary log |
| 30 |
# |
| 31 |
# Related tests; |
| 32 |
# see extra/xa_crash_safe_tests/setup.inc |
| 33 |
# |
| 34 |
if ($recovery_scenario == '') { |
| 35 |
--die ERROR: 'recovery_scenario' parameter needed by 'setup_scenario.inc' |
| 36 |
} |
| 37 |
|
| 38 |
--echo extra/binlog_tests/recovery/end_scenario.inc [$recovery_scenario] |
| 39 |
|
| 40 |
--move_file $target_binlog_file_bak $target_binlog_file |
| 41 |
|
| 42 |
--let $restart_parameters = |
| 43 |
--source include/start_mysqld.inc |
| 44 |
|
| 45 |
if ($end_scenario_stmt != '') { |
| 46 |
--eval $end_scenario_stmt |
| 47 |
--let $end_scenario_stmt = |
| 48 |
} |
| 49 |
|
| 50 |
DELETE FROM t1; |
| 51 |
RESET MASTER; |