diff --git a/sql/slave.cc b/sql/slave.cc index d0396444ace..35a55ceead0 100644 --- a/sql/slave.cc +++ b/sql/slave.cc @@ -4838,7 +4838,13 @@ 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 */