diff options
Diffstat (limited to 'sql/slave.cc')
-rw-r--r-- | sql/slave.cc | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/sql/slave.cc b/sql/slave.cc index c4be7c7a6f7..8568a119fe8 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3632,8 +3632,7 @@ static int process_io_rotate(Master_info *mi, Rotate_log_event *rev) Rotate the relay log makes binlog format detection easier (at next slave start or mysqlbinlog) */ - rotate_relay_log(mi); /* will take the right mutexes */ - DBUG_RETURN(0); + DBUG_RETURN(rotate_relay_log(mi) /* will take the right mutexes */); } /* @@ -4870,12 +4869,13 @@ err: is void). */ -void rotate_relay_log(Master_info* mi) +int rotate_relay_log(Master_info* mi) { DBUG_ENTER("rotate_relay_log"); Relay_log_info* rli= &mi->rli; + int error= 0; - DBUG_EXECUTE_IF("crash_before_rotate_relaylog", abort();); + DBUG_EXECUTE_IF("crash_before_rotate_relaylog", DBUG_SUICIDE();); /* We need to test inited because otherwise, new_file() will attempt to lock @@ -4888,7 +4888,8 @@ void rotate_relay_log(Master_info* mi) } /* If the relay log is closed, new_file() will do nothing. */ - rli->relay_log.new_file(); + if ((error= rli->relay_log.new_file())) + goto end; /* We harvest now, because otherwise BIN_LOG_HEADER_SIZE will not immediately @@ -4905,7 +4906,7 @@ void rotate_relay_log(Master_info* mi) */ rli->relay_log.harvest_bytes_written(&rli->log_space_total); end: - DBUG_VOID_RETURN; + DBUG_RETURN(error); } |