diff --git a/sql/slave.cc b/sql/slave.cc index 67e8ba20c4f..5b1c2029a52 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -3318,7 +3318,13 @@ static Log_event* next_event(RELAY_LOG_INFO* rli) hot_log=0; // Using old binary log } } - + /* + As there is no guarantee that the relay is open (for example, an I/O + error during a write by the slave I/O thread may have closed it), we + have to test it. + */ + if (!my_b_inited(cur_log)) + goto err; #ifndef DBUG_OFF { /* This is an assertion which sometimes fails, let's try to track it */