Debian Codegraph @

mysql-test/suite/galera/t/sql_log_bin.test

raw
1 # Test to check the behavior of galera cluster with sql_log_bin=ON|OFF & binary
2 # logging is disabled. sql_bin_log should not affect galera replication.
3 #
4 # The following bugfixes are tested:
5 #
6 # MDEV-9510: Segmentation fault in binlog thread.
7 # A scenario otherwise causing a similar segfault is replayed.
8 # The test must pass having no crashes.
9 # The sequence of sql statements is provided by original
10 # sql_log_bin.test augmented with a FLUSH BINLOG LOGS, below.
11
12 --source include/galera_cluster.inc
13 --source include/have_innodb.inc
14
15 --echo
16 --echo # On node_1
17 --connection node_1
18
19 USE test;
20 CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
21 INSERT INTO t1 VALUES (1);
22
23 --echo # Disable binary logging for current session
24 SET SQL_LOG_BIN=OFF;
25 INSERT INTO t1 VALUES (2);
26
27 # MDEV-9510: the following binlog rotation due to FLUSH segfaults wo/ the fixes
28 FLUSH BINARY LOGS;
29
30 CREATE TABLE t2(c1 INT PRIMARY KEY) ENGINE=INNODB;
31 INSERT INTO t2 VALUES (1);
32 CREATE TABLE test.t3 AS SELECT * from t1;
33
34 --echo # Enable binary logging for current session
35 SET SQL_LOG_BIN=ON;
36 INSERT INTO t2 VALUES (2);
37 CREATE TABLE t4 AS SELECT * from t2;
38 SELECT * FROM t1;
39 SELECT * FROM t2;
40 SELECT * FROM t3;
41 SELECT * FROM t4;
42
43 --echo
44 --echo # On node_2
45 --connection node_2
46 USE test;
47 SELECT * FROM t1;
48 SELECT * FROM t2;
49 SELECT * FROM t3;
50 SELECT * FROM t4;
51
52 # Cleanup
53 DROP TABLE t1, t2, t3, t4;
54
55 --source include/galera_end.inc
56 --echo # End of test