summaryrefslogtreecommitdiff
path: root/sql/slave.h
diff options
context:
space:
mode:
authorAndrei Elkin <aelkin@mysql.com>2009-06-23 12:10:04 +0300
committerAndrei Elkin <aelkin@mysql.com>2009-06-23 12:10:04 +0300
commit0ecf826a863891312c9b3aa84ccc9a7b781a795a (patch)
tree56e72dd0dbb12bfe48e2228710ee7c8d2f46792f /sql/slave.h
parentecd470d190cd0d391fcdf850276ed10f97890f77 (diff)
downloadmariadb-git-0ecf826a863891312c9b3aa84ccc9a7b781a795a.tar.gz
Bug #38240 Crash in safe_mutex_lock () thr_mutex.c line 97 on rotate_relay_log
The reason for the crash was rotate_relay_log (mi=0x0) did not verify the passed value of active_mi. There are more cases where active_mi is supposed to be non-zero e.g change_master(), stop_slave(), and it's reasonable to protect from a similar crash all of them with common fixes. Fixed with spliting end_slave() in slave threads release and slave data clean-up parts (a new close_active_mi()). The new function is invoked at the very end of close_connections() so that all users of active_mi are proven to have left.
Diffstat (limited to 'sql/slave.h')
-rw-r--r--sql/slave.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/sql/slave.h b/sql/slave.h
index abd63315e62..160418955b5 100644
--- a/sql/slave.h
+++ b/sql/slave.h
@@ -174,7 +174,8 @@ const char *print_slave_db_safe(const char *db);
int check_expected_error(THD* thd, Relay_log_info const *rli, int error_code);
void skip_load_data_infile(NET* net);
-void end_slave(); /* clean up */
+void end_slave(); /* release slave threads */
+void close_active_mi(); /* clean up slave threads data */
void clear_until_condition(Relay_log_info* rli);
void clear_slave_error(Relay_log_info* rli);
void end_relay_log_info(Relay_log_info* rli);