| 1 |
# Test for Bug #41902 MYSQL_BIN_LOG::reset_logs() doesn't call my_error() |
| 2 |
# in face of an error |
| 3 |
# |
| 4 |
|
| 5 |
source include/have_debug.inc; |
| 6 |
source include/master-slave.inc; |
| 7 |
|
| 8 |
# |
| 9 |
# test checks that |
| 10 |
# a. there is no crash when find_log_pos() returns with an error |
| 11 |
# that tests expect to receive; |
| 12 |
# b. in the case of multiple error messages the first error message is |
| 13 |
# reported to the user and others are available as warnings. |
| 14 |
# |
| 15 |
|
| 16 |
connection slave; |
| 17 |
stop slave; |
| 18 |
SET @saved_dbug = @@GLOBAL.debug_dbug; |
| 19 |
SET @@debug_dbug="d,simulate_find_log_pos_error"; |
| 20 |
|
| 21 |
--error ER_UNKNOWN_TARGET_BINLOG |
| 22 |
reset slave; |
| 23 |
show warnings; |
| 24 |
|
| 25 |
SET @@debug_dbug=""; |
| 26 |
reset slave; |
| 27 |
change master to master_host='dummy'; |
| 28 |
|
| 29 |
SET @@debug_dbug="d,simulate_find_log_pos_error"; |
| 30 |
|
| 31 |
--error ER_UNKNOWN_TARGET_BINLOG |
| 32 |
change master to master_host='dummy'; |
| 33 |
|
| 34 |
SET @@debug_dbug=""; |
| 35 |
reset slave; |
| 36 |
change master to master_host='dummy'; |
| 37 |
|
| 38 |
connection master; |
| 39 |
SET @saved_dbug_m = @@global.debug_dbug; |
| 40 |
SET @@debug_dbug="d,simulate_find_log_pos_error"; |
| 41 |
--error ER_UNKNOWN_TARGET_BINLOG |
| 42 |
reset master; |
| 43 |
|
| 44 |
SET @@debug_dbug=""; |
| 45 |
reset master; |
| 46 |
|
| 47 |
SET @@debug_dbug="d,simulate_find_log_pos_error"; |
| 48 |
--error ER_UNKNOWN_TARGET_BINLOG |
| 49 |
purge binary logs to 'master-bin.000001'; |
| 50 |
|
| 51 |
SET @@debug_dbug=""; |
| 52 |
purge binary logs to 'master-bin.000001'; |
| 53 |
|
| 54 |
--disable_query_log |
| 55 |
call mtr.add_suppression("Failed to locate old binlog or relay log files"); |
| 56 |
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ..master-bin.000001 not listed in the index"); |
| 57 |
set @@global.debug_dbug = @saved_dbug_m; |
| 58 |
connection slave; |
| 59 |
call mtr.add_suppression("Failed to locate old binlog or relay log files"); |
| 60 |
call mtr.add_suppression("MYSQL_BIN_LOG::purge_logs was called with file ..master-bin.000001 not listed in the index"); |
| 61 |
--enable_query_log |
| 62 |
SET @@GLOBAL.debug_dbug = @saved_dbug; |
| 63 |
|
| 64 |
--echo ==== clean up ==== |
| 65 |
CHANGE MASTER TO MASTER_HOST = '127.0.0.1'; |
| 66 |
--let $rpl_only_running_threads= 1 |
| 67 |
--source include/rpl_end.inc |