summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mysql-test/suite/rpl/t/rpl_old_master_29078.test1
-rw-r--r--sql/log_event_client.cc13
2 files changed, 10 insertions, 4 deletions
diff --git a/mysql-test/suite/rpl/t/rpl_old_master_29078.test b/mysql-test/suite/rpl/t/rpl_old_master_29078.test
index 34ff5923106..61c83deed28 100644
--- a/mysql-test/suite/rpl/t/rpl_old_master_29078.test
+++ b/mysql-test/suite/rpl/t/rpl_old_master_29078.test
@@ -24,6 +24,7 @@ reset slave;
--source include/start_slave.inc
--sync_with_master
show create table t1;
+set time_zone='+2:00';
select * from t1;
drop table t1;
--source include/stop_slave.inc
diff --git a/sql/log_event_client.cc b/sql/log_event_client.cc
index 9af4e0210e0..79716493417 100644
--- a/sql/log_event_client.cc
+++ b/sql/log_event_client.cc
@@ -1898,10 +1898,15 @@ bool Query_log_event::print_query_header(IO_CACHE* file,
"@@session.autocommit", &need_comma) ||
print_set_option(file, tmp, OPTION_NO_CHECK_CONSTRAINT_CHECKS, ~flags2,
"@@session.check_constraint_checks", &need_comma) ||
- print_set_option(file, tmp, OPTION_IF_EXISTS, flags2,
- "@@session.sql_if_exists", &need_comma)||
- print_set_option(file, tmp, OPTION_EXPLICIT_DEF_TIMESTAMP, flags2,
- "@@session.explicit_defaults_for_timestamp", &need_comma)||
+ (likely(glob_description_event->options_written_to_bin_log &
+ OPTION_IF_EXISTS) &&
+ print_set_option(file, tmp, OPTION_IF_EXISTS, flags2,
+ "@@session.sql_if_exists", &need_comma)) ||
+ (likely(glob_description_event->options_written_to_bin_log &
+ OPTION_EXPLICIT_DEF_TIMESTAMP) &&
+ print_set_option(file, tmp, OPTION_EXPLICIT_DEF_TIMESTAMP, flags2,
+ "@@session.explicit_defaults_for_timestamp",
+ &need_comma)) ||
my_b_printf(file,"%s\n", print_event_info->delimiter))
goto err;
print_event_info->flags2= flags2;