summaryrefslogtreecommitdiff
path: root/mysql-test/suite/rpl/t/rpl_filter_wild_tables_dynamic.test
blob: 6db61927eec710c27c78333cc2bd32a0d49bd055 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Test if dynamic replication wild table filter rules are properly evaluated.
#

source include/have_binlog_format_statement.inc;
source include/master-slave.inc;

connection slave;
--error ER_SLAVE_MUST_STOP
SET @@GLOBAL.replicate_wild_do_table="test.a%";
--error ER_SLAVE_MUST_STOP
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";

connection slave;
source include/stop_slave.inc;
SET @@GLOBAL.replicate_wild_do_table="test.a%";
SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
source include/start_slave.inc;
connection master;

# Table is mentioned in wild-do-table rules
CREATE TABLE a1 (a INT);

# Table is mentioned in wild-ignore-table rules
CREATE TABLE b1 (a INT);

# Table is not mentioned in wild-do-table or wild-ignore-table rules
CREATE TABLE c1 (a INT);

INSERT INTO a1 VALUES (1);
INSERT INTO b1 VALUES (2);
INSERT INTO c1 VALUES (3);

# Only a1 should be replicated to slave
sync_slave_with_master;
SHOW TABLES LIKE '%1';

connection master;

# Clean up
connection master;
DROP TABLE IF EXISTS a1,b1,c1;
--source include/rpl_end.inc

connection slave;
SET @@GLOBAL.replicate_wild_do_table="";
SET @@GLOBAL.replicate_wild_ignore_table="";