diff options
Diffstat (limited to 'sql/sql_repl.cc')
-rw-r--r-- | sql/sql_repl.cc | 33 |
1 files changed, 6 insertions, 27 deletions
diff --git a/sql/sql_repl.cc b/sql/sql_repl.cc index 4e5ce08ab5d..4f31b26fa6f 100644 --- a/sql/sql_repl.cc +++ b/sql/sql_repl.cc @@ -259,24 +259,11 @@ bool log_in_use(const char* log_name) bool purge_error_message(THD* thd, int res) { - uint errmsg= 0; - - switch (res) { - case 0: break; - case LOG_INFO_EOF: errmsg= ER_UNKNOWN_TARGET_BINLOG; break; - case LOG_INFO_IO: errmsg= ER_IO_ERR_LOG_INDEX_READ; break; - case LOG_INFO_INVALID:errmsg= ER_BINLOG_PURGE_PROHIBITED; break; - case LOG_INFO_SEEK: errmsg= ER_FSEEK_FAIL; break; - case LOG_INFO_MEM: errmsg= ER_OUT_OF_RESOURCES; break; - case LOG_INFO_FATAL: errmsg= ER_BINLOG_PURGE_FATAL_ERR; break; - case LOG_INFO_IN_USE: errmsg= ER_LOG_IN_USE; break; - case LOG_INFO_EMFILE: errmsg= ER_BINLOG_PURGE_EMFILE; break; - default: errmsg= ER_LOG_PURGE_UNKNOWN_ERR; break; - } + uint errcode; - if (errmsg) + if ((errcode= purge_log_get_error_code(res)) != 0) { - my_message(errmsg, ER(errmsg), MYF(0)); + my_message(errcode, ER(errcode), MYF(0)); return TRUE; } my_ok(thd); @@ -861,9 +848,7 @@ impossible position"; } else { - DBUG_ASSERT(ret == 0 && signal_cnt != mysql_bin_log.signal_cnt || - thd->killed); - DBUG_PRINT("wait",("binary log received update")); + DBUG_PRINT("wait",("binary log received update or a broadcast signal caught")); } } while (signal_cnt == mysql_bin_log.signal_cnt && !thd->killed); pthread_mutex_unlock(log_lock); @@ -1243,14 +1228,8 @@ int reset_slave(THD *thd, Master_info* mi) goto err; } - /* - Clear master's log coordinates and reset host/user/etc to the values - specified in mysqld's options (only for good display of SHOW SLAVE STATUS; - next init_master_info() (in start_slave() for example) would have set them - the same way; but here this is for the case where the user does SHOW SLAVE - STATUS; before doing START SLAVE; - */ - init_master_info_with_options(mi); + /* Clear master's log coordinates */ + init_master_log_pos(mi); /* Reset errors (the idea is that we forget about the old master). |