Commit 045158fc authored by unknown's avatar unknown
Browse files

Fix for bug #10798: If relay log fails to rotate, slave will crash after

The relay log may not be open for some reason (e.g. disk error) after rotation,
and using it causes the slave crash.

Fix: check we have it open before access, return error otherwise.


sql/slave.cc:
  Fix for bug #10798: If relay log fails to rotate, slave will crash after
    - check if the relay log is open before any access.
parent 3c04f839
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -4284,6 +4284,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
    {
      char llbuf1[22], llbuf2[22];