| 1 |
# ==== Purpose ==== |
| 2 |
# |
| 3 |
# Verify that 'FLUSH LOGS' does not cause assertion failure any more, |
| 4 |
# even if there is no binlog file before executing it. |
| 5 |
# |
| 6 |
# ==== Implementation ==== |
| 7 |
# |
| 8 |
# 1) SET GLOBAL debug='d,error_unique_log_filename' to |
| 9 |
# cause 'FLUSH LOGS' and 'RESET MASTER' commands to error out. |
| 10 |
# 2) Execute 'FLUSH LOGS' to verify that it does not cause |
| 11 |
# assertion failure any more. |
| 12 |
# |
| 13 |
# ==== References ==== |
| 14 |
# |
| 15 |
# Bug #20592961 'FLUSH LOGS' POST FAULT INJECTION HITS ASSERT `! IS_SET()' AT SQL_ERROR.CC:381 |
| 16 |
# Bug #22732184 HEAP-USE-AFTER-FREE IN BINLOG.BINLOG_CHECK_FLUSH_LOG_ASSERTION |
| 17 |
|
| 18 |
# Test in this file is binlog format agnostic, thus no need |
| 19 |
# to rerun them for every format. |
| 20 |
--source include/have_binlog_format_row.inc |
| 21 |
--source include/have_debug.inc |
| 22 |
|
| 23 |
--disable_query_log |
| 24 |
call mtr.add_suppression("Can't generate a unique log-filename"); |
| 25 |
call mtr.add_suppression("MYSQL_BIN_LOG::open failed to generate new file name."); |
| 26 |
call mtr.add_suppression("Failed to locate old binlog or relay log files"); |
| 27 |
call mtr.add_suppression('Could not open .*'); |
| 28 |
--enable_query_log |
| 29 |
SET GLOBAL binlog_error_action= IGNORE_ERROR; |
| 30 |
--let $debug_point= error_unique_log_filename |
| 31 |
--source include/add_debug_point.inc |
| 32 |
|
| 33 |
--error ER_NO_UNIQUE_LOGFILE |
| 34 |
FLUSH LOGS; |
| 35 |
|
| 36 |
# Restart the server to enable binary log. |
| 37 |
--source include/restart_mysqld.inc |
| 38 |
SET GLOBAL binlog_error_action= IGNORE_ERROR; |
| 39 |
--source include/add_debug_point.inc |
| 40 |
|
| 41 |
--error ER_NO_UNIQUE_LOGFILE |
| 42 |
RESET MASTER; |
| 43 |
|
| 44 |
--source include/remove_debug_point.inc |
| 45 |
|
| 46 |
--error ER_UNKNOWN_TARGET_BINLOG |
| 47 |
RESET MASTER; |
| 48 |
SET GLOBAL binlog_error_action= ABORT_SERVER; |
| 49 |
|
| 50 |
# Verify that 'FLUSH LOGS' does not cause assertion failure any more, |
| 51 |
# even if there is no binlog before executing it. |
| 52 |
FLUSH LOGS; |