summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei <andrei.elkin@mariadb.com>2022-07-26 19:09:46 +0300
committerAndrei <andrei.elkin@mariadb.com>2022-07-26 19:09:46 +0300
commiteee78cfd8ee11a3a988414232bbbf37e5340763e (patch)
treea7218156741b2f4edde4feba5fb3ebbe5b0ae71c
parentf852b1b153ae4d28764b314094042f232f653ef9 (diff)
downloadmariadb-git-bb-10.10-MDEV-28632-review.tar.gz
MDEV-29078. Review contribution/notes.bb-10.10-MDEV-28632-review
1. The new test needs an absolute TZ for SELECTing 2. The client mysqlbinlog also is better off to be aware of OLD binlog so it won't generate automatic SET @@explicit_defaults_for_timestamp = 0 in this case. The SET should be left out to the user (like it is for the OLD slave's global explicit_defaults_for_timestamp that should be configured accordingly to the master).
-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;