From 558d069e764f7de4a7e055916e070f700f36ab2a Mon Sep 17 00:00:00 2001 From: Bjorn Munch Date: Wed, 4 Jan 2012 16:16:17 +0100 Subject: [PATCH] Followup after 13055685: Use new syntax to mask different error output in affected tests --- mysql-test/include/show_slave_status.inc | 6 ++++++ mysql-test/include/wait_for_slave_io_error.inc | 4 ++++ mysql-test/suite/rpl/r/rpl_log_pos.result | 1 + .../suite/rpl/r/rpl_manual_change_index_file.result | 1 + mysql-test/suite/rpl/r/rpl_packet.result | 1 + mysql-test/suite/rpl/t/rpl_log_pos.test | 9 +++------ mysql-test/suite/rpl/t/rpl_manual_change_index_file.test | 9 +++------ mysql-test/suite/rpl/t/rpl_packet.test | 9 +++------ 8 files changed, 22 insertions(+), 18 deletions(-) diff --git a/mysql-test/include/show_slave_status.inc b/mysql-test/include/show_slave_status.inc index 67b1c987954..e2fdc72b18b 100644 --- a/mysql-test/include/show_slave_status.inc +++ b/mysql-test/include/show_slave_status.inc @@ -55,6 +55,11 @@ # comma-separated list. Example: # # --let $status_items= Master_Log_File, Relay_Master_Log_File +# +# $slave_io_error_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# --let $_show_slave_status_items=$status_items @@ -70,6 +75,7 @@ while ($_show_slave_status_items) --let $_show_slave_status_items= `SELECT LTRIM(SUBSTRING('$_show_slave_status_items', LENGTH('$_show_slave_status_name') + 2))` --let $_show_slave_status_value= query_get_value(SHOW SLAVE STATUS, $_show_slave_status_name, 1) + --replace_regex $slave_io_error_replace --let $_show_slave_status_value= `SELECT REPLACE("$_show_slave_status_value", '$MYSQL_TEST_DIR', 'MYSQL_TEST_DIR')` --echo $_show_slave_status_name = '$_show_slave_status_value' } diff --git a/mysql-test/include/wait_for_slave_io_error.inc b/mysql-test/include/wait_for_slave_io_error.inc index e1609113b8f..bc78c9e2da1 100644 --- a/mysql-test/include/wait_for_slave_io_error.inc +++ b/mysql-test/include/wait_for_slave_io_error.inc @@ -33,6 +33,10 @@ # (e.g., temporary connection error) and does not cause the slave # IO thread to stop. # +# $slave_io_error_replace +# If set, one or more regex patterns for replacing variable +# text in the error message. Syntax as --replace-regex +# # $slave_timeout # See include/wait_for_slave_param.inc # diff --git a/mysql-test/suite/rpl/r/rpl_log_pos.result b/mysql-test/suite/rpl/r/rpl_log_pos.result index 42b88711f03..72e7c3e2d7f 100644 --- a/mysql-test/suite/rpl/r/rpl_log_pos.result +++ b/mysql-test/suite/rpl/r/rpl_log_pos.result @@ -9,6 +9,7 @@ change master to master_log_pos=MASTER_LOG_POS; Read_Master_Log_Pos = '75' start slave; include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' include/stop_slave_sql.inc show master status; File Position Binlog_Do_DB Binlog_Ignore_DB diff --git a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result index a2dc5d402a7..e41886ddf6b 100644 --- a/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result +++ b/mysql-test/suite/rpl/r/rpl_manual_change_index_file.result @@ -5,6 +5,7 @@ CREATE TABLE t1(c1 INT); FLUSH LOGS; call mtr.add_suppression('Got fatal error 1236 from master when reading data from binary log: .*could not find next log'); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'could not find next log; the last event was read from 'master-bin.000002' at XXX, the last byte read was read from 'master-bin.000002' at XXX.'' CREATE TABLE t2(c1 INT); FLUSH LOGS; CREATE TABLE t3(c1 INT); diff --git a/mysql-test/suite/rpl/r/rpl_packet.result b/mysql-test/suite/rpl/r/rpl_packet.result index 27f85cac7de..864e246312d 100644 --- a/mysql-test/suite/rpl/r/rpl_packet.result +++ b/mysql-test/suite/rpl/r/rpl_packet.result @@ -37,6 +37,7 @@ DROP TABLE t1; CREATE TABLE t1 (f1 int PRIMARY KEY, f2 LONGTEXT, f3 LONGTEXT) ENGINE=MyISAM; INSERT INTO t1(f1, f2, f3) VALUES(1, REPEAT('a', @@global.max_allowed_packet), REPEAT('b', @@global.max_allowed_packet)); include/wait_for_slave_io_error.inc [errno=1236] +Last_IO_Error = 'Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master; the last event was read from 'master-bin.000001' at XXX, the last byte read was read from 'master-bin.000001' at XXX.'' STOP SLAVE; RESET SLAVE; RESET MASTER; diff --git a/mysql-test/suite/rpl/t/rpl_log_pos.test b/mysql-test/suite/rpl/t/rpl_log_pos.test index 882a05712f2..a6521113b37 100644 --- a/mysql-test/suite/rpl/t/rpl_log_pos.test +++ b/mysql-test/suite/rpl/t/rpl_log_pos.test @@ -22,12 +22,9 @@ let $status_items= Read_Master_Log_Pos; source include/show_slave_status.inc; start slave; let $slave_io_errno= 1236; -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# -let $show_slave_io_error= 0; +--let $show_slave_io_error= 1 +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ source include/wait_for_slave_io_error.inc; source include/stop_slave_sql.inc; diff --git a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test index 9b648de8486..8914b215632 100644 --- a/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test +++ b/mysql-test/suite/rpl/t/rpl_manual_change_index_file.test @@ -60,12 +60,9 @@ call mtr.add_suppression('Got fatal error 1236 from master when reading data fro connection slave; # 1236 = ER_MASTER_FATAL_ERROR_READING_BINLOG --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 +--let $show_slave_io_error= 1 +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --source include/wait_for_slave_io_error.inc connection master; diff --git a/mysql-test/suite/rpl/t/rpl_packet.test b/mysql-test/suite/rpl/t/rpl_packet.test index 2b8a1fd8310..06a03131a57 100644 --- a/mysql-test/suite/rpl/t/rpl_packet.test +++ b/mysql-test/suite/rpl/t/rpl_packet.test @@ -125,12 +125,9 @@ connection slave; # The slave I/O thread must stop after receiving # 1236=ER_MASTER_FATAL_ERROR_READING_BINLOG error message from master. --let $slave_io_errno= 1236 -# -# Win and Unix path is printed differently: BUG#13055685. So -# show_slave_io_error is made 0 until the bug fixes provide necessary -# facilities -# ---let $show_slave_io_error= 0 + +# Mask line numbers, and whether master-bin is preceded by "./" or "." +--let $slave_io_error_replace= / at [0-9]*/ at XXX/ /\.\/*master-bin/master-bin/ --source include/wait_for_slave_io_error.inc # Remove the bad binlog and clear error status on slave.