From ffc16a2d06deb125f7ead5c4a9f6eb1fb3b48379 Mon Sep 17 00:00:00 2001 From: Luis Soares Date: Tue, 7 Dec 2010 15:48:18 +0000 Subject: [PATCH] BUG#46166 Post merge fix. In write_incident, check if binlog file is opened before actually trying to write the incident event. --- sql/log.cc | 4 ++++ 1 file changed, 4 insertions(+) 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;