1#
2# Test if dynamic replication wild table filter rules are properly evaluated.
3#
4
5source include/have_binlog_format_statement.inc;
6source include/master-slave.inc;
7
8connection slave;
9--error ER_SLAVE_MUST_STOP
10SET @@GLOBAL.replicate_wild_do_table="test.a%";
11--error ER_SLAVE_MUST_STOP
12SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
13
14connection slave;
15source include/stop_slave.inc;
16SET @@GLOBAL.replicate_wild_do_table="";
17SET @@GLOBAL.replicate_wild_ignore_table="";
18SET @@GLOBAL.replicate_wild_do_table="test.a%";
19SET @@GLOBAL.replicate_wild_ignore_table="test.b%";
20source include/start_slave.inc;
21connection master;
22
23# Table is mentioned in wild-do-table rules
24CREATE TABLE a1 (a INT);
25
26# Table is mentioned in wild-ignore-table rules
27CREATE TABLE b1 (a INT);
28
29# Table is not mentioned in wild-do-table or wild-ignore-table rules
30CREATE TABLE c1 (a INT);
31
32INSERT INTO a1 VALUES (1);
33INSERT INTO b1 VALUES (2);
34INSERT INTO c1 VALUES (3);
35
36# Only a1 should be replicated to slave
37sync_slave_with_master;
38SHOW TABLES LIKE '%1';
39
40connection master;
41
42# Clean up
43connection master;
44DROP TABLE IF EXISTS a1,b1,c1;
45--source include/rpl_end.inc
46
47connection slave;
48SET @@GLOBAL.replicate_wild_do_table="";
49SET @@GLOBAL.replicate_wild_ignore_table="";
50