From 872a953b228e93553ed056d8fa035ff06e884bc8 Mon Sep 17 00:00:00 2001 From: Monty Date: Wed, 15 Jul 2015 16:27:14 +0300 Subject: MDEV-8469 Add RESET MASTER TO x to allow specification of binlog file nr Other things: - Avoid calling init_and_set_log_file_name() when opening binary log. - Remove newlines early when reading from index file. - Ensure that reset_logs() will work even if thd is 0 (Can happen on startup) - Added thd to sart_slave_threads() for better error handling. --- sql/rpl_rli.cc | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'sql/rpl_rli.cc') diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc index e70a436585c..aba568ee317 100644 --- a/sql/rpl_rli.cc +++ b/sql/rpl_rli.cc @@ -228,7 +228,7 @@ a file name for --relay-log-index option", opt_relaylog_index_name); but a destructor will take care of that */ if (rli->relay_log.open_index_file(buf_relaylog_index_name, ln, TRUE) || - rli->relay_log.open(ln, LOG_BIN, 0, SEQ_READ_APPEND, + rli->relay_log.open(ln, LOG_BIN, 0, 0, SEQ_READ_APPEND, mi->rli.max_relay_log_size, 1, TRUE)) { mysql_mutex_unlock(&rli->data_lock); @@ -1076,6 +1076,9 @@ void Relay_log_info::close_temporary_tables() /* purge_relay_logs() + @param rli Relay log information + @param thd thread id. May be zero during startup + NOTES Assumes to have a run lock on rli and that no slave thread are running. */ @@ -1131,7 +1134,7 @@ int purge_relay_logs(Relay_log_info* rli, THD *thd, bool just_reset, rli->cur_log_fd= -1; } - if (rli->relay_log.reset_logs(thd, !just_reset, NULL, 0)) + if (rli->relay_log.reset_logs(thd, !just_reset, NULL, 0, 0)) { *errmsg = "Failed during log reset"; error=1; -- cgit v1.2.1