| 1 |
############################################################################## |
| 2 |
# ==== Purpose ==== |
| 3 |
# The purpose of this test is to verify that appropriate error message is |
| 4 |
# logged when RESET MASTER fails to delete binary log file. |
| 5 |
# |
| 6 |
# ==== Requirement ==== |
| 7 |
# R1. During RESET MASTER, if there are any failures in binary log file |
| 8 |
# deletion, an appropriate error message should be logged. |
| 9 |
# R2. During RESET MASTER, if there are any failures in binary log index file |
| 10 |
# deletion, an appropriate error message should be logged. |
| 11 |
# |
| 12 |
# ==== Implementation ==== |
| 13 |
# 0. Add suppressions for the test and backup data directory |
| 14 |
# 1. Case1: Remove binary log file and create directory with same name as |
| 15 |
# binlog file name |
| 16 |
# 1.1 Save current binlog file name |
| 17 |
# 1.2 Generate new binlog |
| 18 |
# 1.3 Create a directory with same name as binlog file name |
| 19 |
# 1.4 Verify that RESET MASTER failed with error |
| 20 |
# 1.5 Clean up |
| 21 |
# 2. Case2: Remove index file and create directory with same name as index |
| 22 |
# file name |
| 23 |
# 2.1 Create a directory with same name as binlog file name |
| 24 |
# 2.2 verify that reset master failed with error |
| 25 |
# 2.3 Clean up |
| 26 |
# |
| 27 |
# ==== References ==== |
| 28 |
# BUG#33468781: void THD::send_statement_status(): Assertion `0' failed |
| 29 |
############################################################################### |
| 30 |
|
| 31 |
--source include/have_binlog_format_row.inc |
| 32 |
|
| 33 |
--echo # |
| 34 |
--echo # 0. Add suppressions for the test and backup data directory |
| 35 |
call mtr.add_suppression("Failed to delete file.*"); |
| 36 |
RESET MASTER; |
| 37 |
--let $MYSQLD_DATADIR= `SELECT @@datadir` |
| 38 |
--let $BACKUP_DATADIR = $MYSQL_TMP_DIR/data_new |
| 39 |
--force-cpdir $MYSQLD_DATADIR $BACKUP_DATADIR |
| 40 |
|
| 41 |
--echo # |
| 42 |
--echo # 1. Case1: Remove binary log file and create directory with same name |
| 43 |
--echo # as binlog file name |
| 44 |
--echo # |
| 45 |
--echo # 1.1. Save current binlog file name |
| 46 |
--source include/save_binlog_position.inc |
| 47 |
--let $first_binlog_file= $binlog_file |
| 48 |
|
| 49 |
--echo # |
| 50 |
--echo # 1.2 Generate new binlog |
| 51 |
FLUSH BINARY LOGS; |
| 52 |
|
| 53 |
--echo # |
| 54 |
--echo # 1.3 Create a directory with same name as binlog file name |
| 55 |
--move_file $MYSQLD_DATADIR/$first_binlog_file $MYSQLD_DATADIR/$first_binlog_file.orig |
| 56 |
--mkdir $MYSQLD_DATADIR/$first_binlog_file |
| 57 |
|
| 58 |
--echo # |
| 59 |
--echo # 1.4 Verify that RESET MASTER failed with error |
| 60 |
--error ER_BINLOG_PURGE_FATAL_ERR |
| 61 |
RESET MASTER; |
| 62 |
|
| 63 |
--echo # |
| 64 |
--echo # 1.5 Clean up |
| 65 |
# Stop the server |
| 66 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 67 |
--shutdown_server |
| 68 |
--source include/wait_until_disconnected.inc |
| 69 |
# Undo data directory changes |
| 70 |
--force-rmdir $MYSQLD_DATADIR |
| 71 |
--force-cpdir $BACKUP_DATADIR $MYSQLD_DATADIR |
| 72 |
# Restart the server |
| 73 |
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 74 |
-- enable_reconnect |
| 75 |
-- source include/wait_until_connected_again.inc |
| 76 |
|
| 77 |
--echo # |
| 78 |
--echo # 2. Case2: Remove index file and create directory with same name as |
| 79 |
--echo # index file name |
| 80 |
--echo # |
| 81 |
--echo # 2.1 Create a directory with same name as index file name |
| 82 |
--let $index_file= `SELECT @@global.log_bin_index` |
| 83 |
--move_file $index_file $index_file.orig |
| 84 |
--mkdir $index_file |
| 85 |
|
| 86 |
--echo # |
| 87 |
--echo # 2.2 Verify that RESET MASTER failed with error |
| 88 |
--error ER_BINLOG_PURGE_FATAL_ERR |
| 89 |
RESET MASTER; |
| 90 |
|
| 91 |
--echo # |
| 92 |
--echo # 2.3 Cleanup |
| 93 |
# Stop the server |
| 94 |
--exec echo "wait" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 95 |
--shutdown_server |
| 96 |
--source include/wait_until_disconnected.inc |
| 97 |
# Undo data directory changes |
| 98 |
--force-rmdir $MYSQLD_DATADIR |
| 99 |
--force-cpdir $BACKUP_DATADIR $MYSQLD_DATADIR |
| 100 |
--force-rmdir $BACKUP_DATADIR |
| 101 |
# Restart the server |
| 102 |
-- exec echo "restart" > $MYSQLTEST_VARDIR/tmp/mysqld.1.expect |
| 103 |
-- enable_reconnect |
| 104 |
-- source include/wait_until_connected_again.inc |