Debian Codegraph @

mysql-test/suite/galera/t/MDEV-37229.test

raw
1 ##
2 ## Test that mixed binlog replication works at the applier side.
3 ##
4
5 --source include/galera_cluster.inc
6 --source include/have_innodb.inc
7
8 --connection node_2
9 --disable_query_log
10 call mtr.add_suppression("Unsafe statement written to the binary log");
11 --enable_query_log
12
13 --connection node_1
14 --disable_query_log
15 call mtr.add_suppression("Unsafe statement written to the binary log");
16 --enable_query_log
17
18 CREATE TABLE t1 (i INT NOT NULL PRIMARY KEY AUTO_INCREMENT) ENGINE=InnoDB;
19
20 # Try mixed replication: statement then row.
21 SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
22 START TRANSACTION;
23 INSERT INTO t1(i) VALUES(NULL);
24 INSERT INTO t1(i) VALUES(NULL);
25 SET GLOBAL wsrep_forced_binlog_format='ROW';
26 INSERT INTO t1(i) VALUES(NULL);
27 INSERT INTO t1(i) VALUES(NULL);
28 COMMIT;
29
30 # Try mixed replication: row then statement.
31 SET GLOBAL wsrep_forced_binlog_format='ROW';
32 START TRANSACTION;
33 INSERT INTO t1(i) VALUES(NULL);
34 INSERT INTO t1(i) VALUES(NULL);
35 SET GLOBAL wsrep_forced_binlog_format='STATEMENT';
36 INSERT INTO t1(i) VALUES(NULL);
37 INSERT INTO t1(i) VALUES(NULL);
38 COMMIT;
39
40 SELECT * FROM t1 ORDER BY i;
41
42 --connection node_2
43 --let $wait_condition = SELECT COUNT(*) = 8 FROM t1;
44 --source include/wait_condition.inc
45 SELECT * FROM t1 ORDER BY i;
46
47 --connection node_1
48 SET GLOBAL wsrep_forced_binlog_format='NONE';
49 DROP TABLE t1;