# === Purpose === # # This test checks that when a binlog is generated by a server unaware of # original commit timestamp (OCT), if it is applied in a 8.0+ server, the OCT # will be correctly generated. # # === Implementation === # # First, generate some transactions on the server. # Run mysqlbinlog modified so that the "SET original_commit_timestamp" statement # is not printed. # The server is then reset so that the transactions can be applied again. # Finally, check that the OCT of the replayed transactions is set to zero, since # they were not originated in this server. # # === Related Bug === # # BUG#25316086 MYSQL 8.0 ASSUME TRX BEING APPLIED WITH 5.7- MYSQLBINLOG DUMP AS # ORIGINAL --source include/mysqlbinlog_have_debug.inc --source include/have_debug.inc --source include/have_log_bin.inc RESET MASTER; # Run some transactions on the master --let $uuid=aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa --eval SET SESSION GTID_NEXT= '$uuid:1' CREATE TABLE t1 (a INT); --eval SET SESSION GTID_NEXT= '$uuid:2' DROP TABLE t1; SET @@SESSION.GTID_NEXT= 'AUTOMATIC'; --let $binlog= query_get_value(SHOW MASTER STATUS, File, 1) --let $binlog_path= `SELECT CONCAT(@@DATADIR, '$binlog')` --echo # run mysqlbinlog with a flag so that the OCT is not printed --echo # to simulate a 5.7 mysqlbinlog --exec $MYSQL_BINLOG -#d,do_not_write_rpl_OCT --force-if-open $binlog_path > $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql # reset the server so we can replay the transactions RESET MASTER; --echo # replay the transactions on the server --exec $MYSQL test < $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql # check that the OCT of the two transactions is zero --let $i= 1 while ($i < 3) { --let $gtid= $uuid:$i --source include/get_original_commit_timestamp.inc --let $assert_text= The OCT is zero for GTID $uuid:$i --let $assert_cond= $original_commit_timestamp = 0 --source include/assert.inc --inc $i } # cleanup --remove_file $MYSQLTEST_VARDIR/tmp/mysqlbinlog.sql