From 1c37ac84ef102f4e45d68f1442832a29387c27ba Mon Sep 17 00:00:00 2001 From: Alexander Barkov Date: Tue, 4 Dec 2018 18:11:45 +0400 Subject: [PATCH] MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave The previous patch 269da4bf192d4fe4291eb3d6013e681af2ddcbef was actually for MDEV-8894 (not for MDEV-5377). It was erroneously pushed with a wrong title. This patch is a small cleanup for MDEV-8894. CREATE TABLE is now not a part of binary logs recorded with MySQL, only INSERT statements are. This will allow to reuse the same binary logs in combinations with different CREATE TABLE statements, to tests different data types. --- ...ql-5.7.11-stm-temporal-round-binlog.000001 | Bin 695 -> 514 bytes ...ql-8.0.13-stm-temporal-round-binlog.000001 | Bin 1095 -> 892 bytes .../r/rpl_mysql57_stm_temporal_round.result | 1 + .../r/rpl_mysql80_stm_temporal_round.result | 1 + .../rpl/t/rpl_mysql57_stm_temporal_round.test | 14 +++++++++++--- .../rpl/t/rpl_mysql80_stm_temporal_round.test | 18 +++++++++++++----- 6 files changed, 26 insertions(+), 8 deletions(-) diff --git a/mysql-test/std_data/rpl/mysql-5.7.11-stm-temporal-round-binlog.000001 b/mysql-test/std_data/rpl/mysql-5.7.11-stm-temporal-round-binlog.000001 index a8de8b8c76000c05f0941a3c7343dcc4d9151e14..5010e164e437b64fc21140b9b1aaa95aadde2cfe 100644 GIT binary patch delta 186 zcmdna+Qh=~FDWyxq@FEiB8M{znD*D;NJ`(?1ZLNZb1VwKw50+hKhILgF(>;fh|R>v zz`)=S#9EW*G1?k4?ubhS3A2KP6@b_a#9#oc0x=kBI0WI^nt=Q>jFb78@~!^mR{aKv l3xJf%1MzE!J|GJO{O)YcsRK$ggG9xFn28A_ypQqqegGbFDzpFq delta 304 zcmZo-+0M%GFDWx`V%Wdvi5$)>VA@}Uz~d6$aDih5kT+`x9Tq nH;@ml{4Wi120V~cQJisvQ*6EgP?{O!0C6C$0ZXf1x%L$R+h}(m literal 1095 zcmeyDl$m!<`d>6ZBLf3N1rXN&F#`h&gN2@fo}saBN@`MRI#`Gx0WwCIftP^;VgL(} zN?>4-0&zJwIGBJG7Z;b77K4xp0~h1H)!hF;8k9ly$^-FiAZ`F+2(Y;ub>cEmS_vfW z3B*sp;vgPY05Tm6U@E3@$*F9rW<9;!`Lr^~ASRGR6A-6?Rj@-;1O3UM4`ISIGO#fh zm!z=hGJqftV@Yap34M4}%CVk@+u073 zUjvpW*G^AAU?_zsc>0C-gM%$mQz6XJC)71qK||fhz`#%!j1&wEtiVXm5)9Ne*Or;9 zfSe%!awaIfoJMiR0oj&TkTf{GfC5>J8Avd|!vVxW225bxKoPJqAbqkK7RYAN>fCS- zg914Vs0L>sgKQui$SE==6F_Fd1Gx)qFWeO=U;X{yc7g&~5R`jxMJz!($qi(q9S`P$ koBt<8 diff --git a/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result b/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result index cd2cbd5aa54..bedd103c2a0 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result +++ b/mysql-test/suite/rpl/r/rpl_mysql57_stm_temporal_round.result @@ -4,6 +4,7 @@ include/master-slave.inc [connection master] connection slave; +CREATE TABLE t1 (id SERIAL, a DATETIME(3)); include/stop_slave.inc connection master; include/rpl_stop_server.inc [server_number=1] diff --git a/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result b/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result index c1408deb467..23b3217895a 100644 --- a/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result +++ b/mysql-test/suite/rpl/r/rpl_mysql80_stm_temporal_round.result @@ -4,6 +4,7 @@ include/master-slave.inc [connection master] connection slave; +CREATE TABLE t1 (id SERIAL, a DATETIME(3)); include/stop_slave.inc connection master; include/rpl_stop_server.inc [server_number=1] diff --git a/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test b/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test index e29d15fbf4f..675b7db0603 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test +++ b/mysql-test/suite/rpl/t/rpl_mysql57_stm_temporal_round.test @@ -1,3 +1,5 @@ +--source include/have_binlog_format_statement.inc + --echo # --echo # MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave --echo # @@ -6,6 +8,7 @@ --source include/master-slave.inc --connection slave +CREATE TABLE t1 (id SERIAL, a DATETIME(3)); --source include/stop_slave.inc --connection master @@ -19,10 +22,15 @@ # # Simulate MySQL 5.7.x master # -# mysql-5.7.11-stm-temporal-round-binlog.000001 was recorded with -# "mysqld --log-bin --binlog-format=statement", with the following SQL script: -# +# mysql-5.7.11-stm-temporal-round-binlog.000001 was recorded against a +# table with this structure: #CREATE TABLE t1 (id SERIAL, a DATETIME(3)); +# (note, the CREATE statement is not inside the binary log) +# +# using this command line: +# mysqld --log-bin --binlog-format=statement +# with the following single SQL statement: +# #INSERT INTO t1 (a) VALUES ('2001-01-01 00:00:00.999999'); # diff --git a/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test b/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test index a4d0734d225..ad6df9d9993 100644 --- a/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test +++ b/mysql-test/suite/rpl/t/rpl_mysql80_stm_temporal_round.test @@ -1,3 +1,5 @@ +--source include/have_binlog_format_statement.inc + --echo # --echo # MDEV-8894 Inserting fractional seconds into MySQL 5.6 master breaks consistency on MariaDB 10 slave --echo # @@ -6,6 +8,7 @@ --source include/master-slave.inc --connection slave +CREATE TABLE t1 (id SERIAL, a DATETIME(3)); --source include/stop_slave.inc --connection master @@ -19,12 +22,17 @@ # # Simulate MySQL 8.0.x master # -# mysql-8.0.13-stm-temporal-round-binlog.000001 was recorded with -# "mysqld --log-bin --binlog-format=statement", with the following SQL script: -# -#SET NAMES utf8mb4 COLLATE utf8mb4_general_ci; -#SET sql_mode=''; +# mysql-8.0.13-stm-temporal-round-binlog.000001 was recorded against a +# table with this structure: #CREATE TABLE t1 (id SERIAL, a DATETIME(3)); +# (note, the CREATE statement is not inside the binary log) +# +# using this command line: +# mysqld --log-bin --binlog-format=statement --server-id=1 --character-set-server=latin1 +# with the following SQL script: +# +#SET NAMES latin1 COLLATE latin1_swedish_ci; +#SET sql_mode=''; #INSERT INTO t1 (a) VALUES ('2001-01-01 00:00:00.999999'); #SET sql_mode=TIME_TRUNCATE_FRACTIONAL; #INSERT INTO t1 (a) VALUES ('2001-01-01 00:00:00.999999');