Commit b6f80330 authored by Philip Stoev's avatar Philip Stoev Committed by Nirbhay Choubey

Galera MTR Tests: Tests around do-* and ignore-* binlog options

parent f7885fb6
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO db1.t1 VALUES (1);
INSERT INTO db2.t2A VALUES (2);
INSERT INTO db2.t2B VALUES (3);
SELECT COUNT(*) = 0 FROM db1.t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM db2.t2A;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM db2.t2B;
COUNT(*) = 1
1
SELECT COUNT(*) = 0 FROM db1.t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM db2.t2A;
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM db2.t2B;
COUNT(*) = 1
1
DROP SCHEMA db1;
DROP SCHEMA db2;
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO db1.t1 VALUES (1);
INSERT INTO db2.t2A VALUES (2);
INSERT INTO db2.t2B VALUES (3);
SELECT COUNT(*) = 0 FROM db1.t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 0 FROM db2.t2A;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM db2.t2B;
COUNT(*) = 1
1
SELECT COUNT(*) = 0 FROM db1.t1;
COUNT(*) = 0
1
SELECT COUNT(*) = 1 FROM db2.t2A;
COUNT(*) = 1
1
SELECT COUNT(*) = 1 FROM db2.t2B;
COUNT(*) = 1
1
DROP SCHEMA db1;
DROP SCHEMA db2;
!include ../galera_3nodes.cnf
[mysqld.1]
binlog-do-db=db2
[mysqld.2]
replicate-wild-do-table=db2.t2B
#
# This tests checks the operation of binlog-do-db , replicate-wild-do-table
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO db1.t1 VALUES (1);
INSERT INTO db2.t2A VALUES (2);
INSERT INTO db2.t2B VALUES (3);
--connection node_2
SELECT COUNT(*) = 0 FROM db1.t1;
SELECT COUNT(*) = 0 FROM db2.t2A;
SELECT COUNT(*) = 1 FROM db2.t2B;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
SELECT COUNT(*) = 0 FROM db1.t1;
SELECT COUNT(*) = 1 FROM db2.t2A;
SELECT COUNT(*) = 1 FROM db2.t2B;
--connection node_1
DROP SCHEMA db1;
DROP SCHEMA db2;
!include ../galera_3nodes.cnf
[mysqld.1]
binlog-ignore-db=db1
[mysqld.2]
replicate-wild-ignore-table=db2.t2A
#
# This tests checks the operation of binlog-ignore-db , replicate-wild-ignore-table
#
--source include/galera_cluster.inc
--source include/have_innodb.inc
--connection node_1
CREATE DATABASE db1;
CREATE DATABASE db2;
CREATE TABLE db1.t1 (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2A (f1 INTEGER) ENGINE=InnoDB;
CREATE TABLE db2.t2B (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO db1.t1 VALUES (1);
INSERT INTO db2.t2A VALUES (2);
INSERT INTO db2.t2B VALUES (3);
--connection node_2
SELECT COUNT(*) = 0 FROM db1.t1;
SELECT COUNT(*) = 0 FROM db2.t2A;
SELECT COUNT(*) = 1 FROM db2.t2B;
--connect node_3, 127.0.0.1, root, , test, $NODE_MYPORT_3
--connection node_3
SELECT COUNT(*) = 0 FROM db1.t1;
SELECT COUNT(*) = 1 FROM db2.t2A;
SELECT COUNT(*) = 1 FROM db2.t2B;
--connection node_1
DROP SCHEMA db1;
DROP SCHEMA db2;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment