summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/slave.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/sql/slave.cc b/sql/slave.cc
index b77d154a08f..5ff05046895 100644
--- a/sql/slave.cc
+++ b/sql/slave.cc
@@ -4836,7 +4836,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 */