summaryrefslogtreecommitdiff
path: root/mysql-test/extra
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@sun.com>2009-06-03 15:14:18 +0100
committerLuis Soares <luis.soares@sun.com>2009-06-03 15:14:18 +0100
commit11f1ab1069b63b6b6cc445b538e1daffa848d6d7 (patch)
tree097bea8a2cd0c52321a57444f678896901d2b769 /mysql-test/extra
parent76e12894dc386a7167145a425c3c7cdbcf01a113 (diff)
downloadmariadb-git-11f1ab1069b63b6b6cc445b538e1daffa848d6d7.tar.gz
BUG#44270: RESET SLAVE does not reset Last_IO_Error or Last_IO_Errno
The server was not cleaning the last IO error and error number when resetting slave. This patch addresses this issue by backporting into 5.1 part of the patch in BUG 34654. A fix for this issue had already been pushed into 6.0 as part of the aforementioned bug, however the patch also included some refactoring. The fix for 5.1 does not take into account the refactoring part. mysql-test/extra/rpl_tests/rpl_reset_slave.test: Backported the test case and improved with deploying include/start_slave.inc in relevant spots. sql/slave.cc: Backported part of patch from 6.0 that includes cleaning mi->clear_error() at: 1. beginning of handle_slave_io 2. on successful connection Also, backported the assertion added in the original patch. sql/sql_repl.cc: Backported the call to mi->clear_error() on reset_slave().
Diffstat (limited to 'mysql-test/extra')
-rw-r--r--mysql-test/extra/rpl_tests/rpl_reset_slave.test54
1 files changed, 54 insertions, 0 deletions
diff --git a/mysql-test/extra/rpl_tests/rpl_reset_slave.test b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
index 2cc041a35e1..49a142f10c2 100644
--- a/mysql-test/extra/rpl_tests/rpl_reset_slave.test
+++ b/mysql-test/extra/rpl_tests/rpl_reset_slave.test
@@ -41,3 +41,57 @@ reset slave;
start slave;
sync_with_master;
show status like 'slave_open_temp_tables';
+
+#
+#Bug#34654 RESET SLAVE does not clear LAST_IO_Err*
+#
+
+# clearing the status
+stop slave;
+reset slave;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+echo *** errno must be zero: $last_io_errno ***;
+
+#
+# verifying start slave resets Last_IO_Error and Last_IO_Errno.
+#
+
+change master to master_user='impossible_user_name';
+start slave;
+source include/wait_for_slave_io_to_stop.inc;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+--disable_query_log
+eval SELECT $last_io_errno > 0 as ONE;
+--enable_query_log
+
+source include/stop_slave.inc;
+change master to master_user='root';
+source include/start_slave.inc;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+--echo *** last errno must be zero: $last_io_errno ***
+--echo *** last error must be blank: $last_io_error ***
+
+#
+# verifying reset slave resets Last_{IO,SQL}_Err{or,no}
+#
+
+source include/stop_slave.inc;
+change master to master_user='impossible_user_name';
+start slave;
+source include/wait_for_slave_io_to_stop.inc;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+--disable_query_log
+eval SELECT $last_io_errno > 0 as ONE;
+--enable_query_log
+
+source include/stop_slave.inc;
+reset slave;
+let $last_io_errno= query_get_value(SHOW SLAVE STATUS, Last_IO_Errno, 1);
+let $last_io_error= query_get_value(SHOW SLAVE STATUS, Last_IO_Error, 1);
+let $last_sql_errno= query_get_value(SHOW SLAVE STATUS, Last_SQL_Errno, 1);
+let $last_sql_error= query_get_value(SHOW SLAVE STATUS, Last_SQL_Error, 1);
+--echo *** io last errno must be zero: $last_io_errno ***
+--echo *** io last error must be blank: $last_io_error ***
+--echo *** sql last errno must be zero: $last_sql_errno ***
+--echo *** sql last error must be blank: $last_sql_error ***