diff options
Diffstat (limited to 'sql/repl_failsafe.cc')
-rw-r--r-- | sql/repl_failsafe.cc | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/sql/repl_failsafe.cc b/sql/repl_failsafe.cc index 705ef58d0e7..eabba9c68fc 100644 --- a/sql/repl_failsafe.cc +++ b/sql/repl_failsafe.cc @@ -191,10 +191,12 @@ void init_slave_list() void end_slave_list() { - pthread_mutex_lock(&LOCK_slave_list); - hash_free(&slave_list); - pthread_mutex_unlock(&LOCK_slave_list); - pthread_mutex_destroy(&LOCK_slave_list); + /* No protection by a mutex needed as we are only called at shutdown */ + if (hash_inited(&slave_list)) + { + hash_free(&slave_list); + pthread_mutex_destroy(&LOCK_slave_list); + } } static int find_target_pos(LEX_MASTER_INFO* mi, IO_CACHE* log, char* errmsg) @@ -256,7 +258,7 @@ int translate_master(THD* thd, LEX_MASTER_INFO* mi, char* errmsg) } linfo.index_file_offset = 0; - + search_file_name[0] = 0; @@ -364,7 +366,7 @@ static Slave_log_event* find_slave_event(IO_CACHE* log, int i; bool slave_event_found = 0; LINT_INIT(ev); - + for (i = 0; i < 2; i++) { if (!(ev = Log_event::read_log_event(log, (pthread_mutex_t*)0, 0))) @@ -436,7 +438,7 @@ int update_slave_list(MYSQL* mysql) const char* error=0; bool have_auth_info; int port_ind; - + if (mc_mysql_query(mysql,"SHOW SLAVE HOSTS",0) || !(res = mc_mysql_store_result(mysql))) { @@ -504,7 +506,7 @@ err: int find_recovery_captain(THD* thd, MYSQL* mysql) { - + return 0; } @@ -849,7 +851,3 @@ err: return error; } - - - - |