1
-- source include/have_binlog_format_mixed_or_statement.inc
2
-- source include/not_ndb_default.inc
3
-- source include/master-slave.inc
5
set @saved_binlog_format = @@global.binlog_format;
7
# Test that the slave temporarily switches to ROW when seeing binrow
8
# events when it is in STATEMENT or MIXED mode
10
SET BINLOG_FORMAT=MIXED;
11
SET GLOBAL BINLOG_FORMAT=MIXED;
12
SELECT @@GLOBAL.BINLOG_FORMAT, @@SESSION.BINLOG_FORMAT;
14
--echo **** On Master ****
15
CREATE TABLE t1 (a INT, b LONG);
16
INSERT INTO t1 VALUES (1,1), (2,2);
17
INSERT INTO t1 VALUES (3,UUID()), (4,UUID());
18
let $VERSION=`select version()`;
19
--replace_result $VERSION VERSION
20
--replace_column 2 # 5 #
21
--replace_regex /table_id: [0-9]+/table_id: #/
22
# Different number of binlog events are generated by different engines
26
sync_slave_with_master;
27
--echo **** On Slave ****
28
--replace_result $MASTER_MYPORT MASTER_PORT
29
--replace_column 1 # 7 # 8 # 9 # 22 # 23 # 33 #
30
--query_vertical SHOW SLAVE STATUS
31
--replace_result $VERSION VERSION
32
--replace_column 2 # 5 #
33
--replace_regex /table_id: [0-9]+/table_id: #/
34
# Different number of binlog events are generated by different engines
38
--exec $MYSQL_DUMP --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql
39
--exec $MYSQL_DUMP_SLAVE --compact --order-by-primary --skip-extended-insert --no-create-info test > $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql
42
DROP TABLE IF EXISTS t1;
44
# Let's compare. Note: If they match test will pass, if they do not match
45
# the test will show that the diff statement failed and not reject file
46
# will be created. You will need to go to the mysql-test dir and diff
47
# the files your self to see what is not matching
49
diff_files $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
51
# If all is good, we can remove the files
53
remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_master.sql;
54
remove_file $MYSQLTEST_VARDIR/tmp/rpl_rbr_to_sbr_slave.sql;
56
# Restoring to the original values
57
SET GLOBAL BINLOG_FORMAT=@saved_binlog_format;