diff --git a/sql/log_event.cc b/sql/log_event.cc index 0aeec20b2ea..7cf27438700 100644 --- a/sql/log_event.cc +++ b/sql/log_event.cc @@ -1509,7 +1509,7 @@ Query_log_event::Query_log_event(const uchar *buf, uint event_len, switch (*pos++) { case Q_FLAGS2_CODE: CHECK_SPACE(pos, end, 4); - flags2_inited= 1; + flags2_inited= description_event->options_written_to_bin_log; flags2= uint4korr(pos); DBUG_PRINT("info",("In Query_log_event, read flags2: %lu", (ulong) flags2)); pos+= 4; diff --git a/sql/log_event.h b/sql/log_event.h index 82cfe0abfa6..b031fec665d 100644 --- a/sql/log_event.h +++ b/sql/log_event.h @@ -2099,7 +2099,7 @@ class Query_log_event: public Log_event flags2==0 (5.0 master, we know this has a meaning of flags all down which must influence the query). */ - bool flags2_inited; + uint32 flags2_inited; bool sql_mode_inited; bool charset_inited; diff --git a/sql/log_event_server.cc b/sql/log_event_server.cc index 2cae9f60e4e..02fb8d9dd80 100644 --- a/sql/log_event_server.cc +++ b/sql/log_event_server.cc @@ -1728,7 +1728,7 @@ int Query_log_event::do_apply_event(rpl_group_info *rgi, OPTIONS_WRITTEN_TO_BIN_LOG must take their value from flags2. */ - ulonglong mask= rli->relay_log.description_event_for_exec->options_written_to_bin_log; + ulonglong mask= flags2_inited; thd->variables.option_bits= (flags2 & mask) | (thd->variables.option_bits & ~mask); }