summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sql/log.cc4
1 files changed, 4 insertions, 0 deletions
diff --git a/sql/log.cc b/sql/log.cc
index 46dcec2e2cd..5fcb5fe0367 100644
--- a/sql/log.cc
+++ b/sql/log.cc
@@ -4828,6 +4828,10 @@ bool MYSQL_BIN_LOG::write_incident(THD *thd, bool lock)
{
uint error= 0;
DBUG_ENTER("MYSQL_BIN_LOG::write_incident");
+
+ if (!is_open())
+ DBUG_RETURN(error);
+
LEX_STRING const write_error_msg=
{ C_STRING_WITH_LEN("error writing to the binary log") };
Incident incident= INCIDENT_LOST_EVENTS;