Skip to content

Commit b6f8033

Browse files
philip-galeraNirbhay Choubey
authored andcommitted
Galera MTR Tests: Tests around do-* and ignore-* binlog options
1 parent f7885fb commit b6f8033

File tree

6 files changed

+138
-0
lines changed

6 files changed

+138
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CREATE DATABASE db1;
2+
CREATE DATABASE db2;
3+
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
4+
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
5+
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
6+
INSERT INTO db1.t1 VALUES (1);
7+
INSERT INTO db2.t2A VALUES (2);
8+
INSERT INTO db2.t2B VALUES (3);
9+
SELECT COUNT(*) = 0 FROM db1.t1;
10+
COUNT(*) = 0
11+
1
12+
SELECT COUNT(*) = 0 FROM db2.t2A;
13+
COUNT(*) = 0
14+
1
15+
SELECT COUNT(*) = 1 FROM db2.t2B;
16+
COUNT(*) = 1
17+
1
18+
SELECT COUNT(*) = 0 FROM db1.t1;
19+
COUNT(*) = 0
20+
1
21+
SELECT COUNT(*) = 1 FROM db2.t2A;
22+
COUNT(*) = 1
23+
1
24+
SELECT COUNT(*) = 1 FROM db2.t2B;
25+
COUNT(*) = 1
26+
1
27+
DROP SCHEMA db1;
28+
DROP SCHEMA db2;
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
CREATE DATABASE db1;
2+
CREATE DATABASE db2;
3+
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
4+
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
5+
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
6+
INSERT INTO db1.t1 VALUES (1);
7+
INSERT INTO db2.t2A VALUES (2);
8+
INSERT INTO db2.t2B VALUES (3);
9+
SELECT COUNT(*) = 0 FROM db1.t1;
10+
COUNT(*) = 0
11+
1
12+
SELECT COUNT(*) = 0 FROM db2.t2A;
13+
COUNT(*) = 0
14+
1
15+
SELECT COUNT(*) = 1 FROM db2.t2B;
16+
COUNT(*) = 1
17+
1
18+
SELECT COUNT(*) = 0 FROM db1.t1;
19+
COUNT(*) = 0
20+
1
21+
SELECT COUNT(*) = 1 FROM db2.t2A;
22+
COUNT(*) = 1
23+
1
24+
SELECT COUNT(*) = 1 FROM db2.t2B;
25+
COUNT(*) = 1
26+
1
27+
DROP SCHEMA db1;
28+
DROP SCHEMA db2;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!include ../galera_3nodes.cnf
2+
3+
[mysqld.1]
4+
binlog-do-db=db2
5+
6+
[mysqld.2]
7+
replicate-wild-do-table=db2.t2B
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# This tests checks the operation of binlog-do-db , replicate-wild-do-table
3+
#
4+
5+
--source include/galera_cluster.inc
6+
--source include/have_innodb.inc
7+
8+
--connection node_1
9+
CREATE DATABASE db1;
10+
CREATE DATABASE db2;
11+
12+
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
13+
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
14+
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
15+
16+
INSERT INTO db1.t1 VALUES (1);
17+
INSERT INTO db2.t2A VALUES (2);
18+
INSERT INTO db2.t2B VALUES (3);
19+
20+
--connection node_2
21+
SELECT COUNT(*) = 0 FROM db1.t1;
22+
SELECT COUNT(*) = 0 FROM db2.t2A;
23+
SELECT COUNT(*) = 1 FROM db2.t2B;
24+
25+
26+
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
27+
--connection node_3
28+
SELECT COUNT(*) = 0 FROM db1.t1;
29+
SELECT COUNT(*) = 1 FROM db2.t2A;
30+
SELECT COUNT(*) = 1 FROM db2.t2B;
31+
32+
--connection node_1
33+
DROP SCHEMA db1;
34+
DROP SCHEMA db2;
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
!include ../galera_3nodes.cnf
2+
3+
[mysqld.1]
4+
binlog-ignore-db=db1
5+
6+
[mysqld.2]
7+
replicate-wild-ignore-table=db2.t2A
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
#
2+
# This tests checks the operation of binlog-ignore-db , replicate-wild-ignore-table
3+
#
4+
5+
--source include/galera_cluster.inc
6+
--source include/have_innodb.inc
7+
8+
--connection node_1
9+
CREATE DATABASE db1;
10+
CREATE DATABASE db2;
11+
12+
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
13+
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
14+
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
15+
16+
INSERT INTO db1.t1 VALUES (1);
17+
INSERT INTO db2.t2A VALUES (2);
18+
INSERT INTO db2.t2B VALUES (3);
19+
20+
--connection node_2
21+
SELECT COUNT(*) = 0 FROM db1.t1;
22+
SELECT COUNT(*) = 0 FROM db2.t2A;
23+
SELECT COUNT(*) = 1 FROM db2.t2B;
24+
25+
26+
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
27+
--connection node_3
28+
SELECT COUNT(*) = 0 FROM db1.t1;
29+
SELECT COUNT(*) = 1 FROM db2.t2A;
30+
SELECT COUNT(*) = 1 FROM db2.t2B;
31+
32+
--connection node_1
33+
DROP SCHEMA db1;
34+
DROP SCHEMA db2;

0 commit comments

Comments
 (0)