diff options
author | Luis Soares <luis.soares@sun.com> | 2009-06-03 15:14:18 +0100 |
---|---|---|
committer | Luis Soares <luis.soares@sun.com> | 2009-06-03 15:14:18 +0100 |
commit | 11f1ab1069b63b6b6cc445b538e1daffa848d6d7 (patch) | |
tree | 097bea8a2cd0c52321a57444f678896901d2b769 /sql/slave.cc | |
parent | 76e12894dc386a7167145a425c3c7cdbcf01a113 (diff) | |
download | mariadb-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 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index c379a67201a..679de890801 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -2397,6 +2397,7 @@ pthread_handler_t handle_slave_io(void *arg) pthread_detach_this_thread(); thd->thread_stack= (char*) &thd; // remember where our stack is + mi->clear_error(); if (init_slave_thread(thd, SLAVE_THD_IO)) { pthread_cond_broadcast(&mi->start_cond); @@ -2511,6 +2512,7 @@ requesting master dump") || goto connected; }); + DBUG_ASSERT(mi->last_error().number == 0); while (!io_slave_killed(thd,mi)) { ulong event_len; @@ -3710,6 +3712,7 @@ static int connect_to_master(THD* thd, MYSQL* mysql, Master_info* mi, if (!slave_was_killed) { + mi->clear_error(); // clear possible left over reconnect error if (reconnect) { if (!suppress_warnings && global_system_variables.log_warnings) |