Debian Codegraph @

mysql-test/suite/rpl_gtid/t/rpl_db_stmts_ignored.test

raw
1 #
2 # ==== Purpose ====
3 #
4 # This test script is created to test how filtering rules act
5 # against CREATE/ALTER/DROP DATABASE commands (CAD commands)
6 # Also it will check that there will be gtid empty transaction
7 # created after these CAD commands are filtered out.
8 #
9 # ==== Implementation ====
10 #
11 # USE-CASE 1: Test --replication-ignore-db=db1 filter
12 #
13 # S1: Install --replication-ignore-db=db1 filter on slave
14 # S2: Try all three CAD statements (CREATE/ALTER/DROP)
15 # S3: Check that they are filtered and check that there is no gap in
16 # GTID_EXECUTED_SET.
17 # USE-CASE 2: Repeat S1-S3 steps against --replicate-do-db=db2 filter rule.
18 # USE-CASE 3: Repeat S1-S3 steps against --replicate-wild-ignore-table=db1.%
19 # filter rule.
20 # USE-CASE 4: Repeat S1-S3 steps against --replicate-do-db=db2 and
21 # --replicate-wild-ignore-table=db1.t% filter rule.
22 #
23 # ==== References ====
24 #
25 # Bug#27308751 FILTERED REPLICATION LEAVES GTID HOLES WITH CREATE DATABASE
26 #
27 --source include/have_binlog_format_statement.inc
28 --source include/master-slave.inc
29
30 --echo #
31 --echo # Test replicate-ignore-db=db1 filter
32 --echo #
33 #
34 # Test replicate-ignore-db=db1 filter rule on
35 # CREATE/ALTER/DROP DATABASE 'db1' command
36 # These commands should be skipped.
37 #
38 --let $rpl_server_number= 2
39 --let $rpl_start_with_gtids= 1
40 --let $rpl_server_parameters=--replicate-ignore-db=db1 --skip_replica_start=FALSE
41 --source include/rpl_restart_server.inc
42 --source extra/rpl_tests/rpl_db_stmts_ignored.inc
43
44 --echo #
45 --echo # Test replicate-do-db=db2 filter
46 --echo #
47 #
48 # Test replicate-do-db=db2 filter rule on
49 # CREATE/ALTER/DROP DATABASE 'db1' command
50 # These commands should be skipped.
51 #
52 --let $rpl_server_number= 2
53 --let $rpl_start_with_gtids= 1
54 --let $rpl_server_parameters=--replicate-do-db=db2 --skip_replica_start=FALSE
55 --source include/rpl_restart_server.inc
56 --source extra/rpl_tests/rpl_db_stmts_ignored.inc
57
58 --echo #
59 --echo # Test replicate-wild-ignore-table=db1.% filter
60 --echo #
61 #
62 # Test replicate-wild-ignore-table=db1.% filter rule on
63 # CREATE/ALTER/DROP DATABASE 'db1' command.
64 # These commands should be skipped.
65 #
66 --let $rpl_server_number= 2
67 --let $rpl_start_with_gtids= 1
68 --let $rpl_server_parameters=--replicate-wild-ignore-table=db1.% --skip_replica_start=FALSE
69 --source include/rpl_restart_server.inc
70 --source extra/rpl_tests/rpl_db_stmts_ignored.inc
71
72 --echo #
73 --echo # Test replicate-wild-ignore-table=db1.% and --replicate-do-db=db2
74 --echo # filter combination
75 #
76 # Test replicate-wild-ignore-table=db1.% and --replicate-do-db=db2
77 # filter combination rule on CREATE/ALTER/DROP DATABASE 'db1' command.
78 # These commands should be skipped.
79 #
80 --let $rpl_server_number= 2
81 --let $rpl_start_with_gtids= 1
82 --let $rpl_server_parameters= --replicate-do-db=db2 --replicate-wild-ignore-table=db1.t% --skip_replica_start=FALSE
83 --source include/rpl_restart_server.inc
84 --source extra/rpl_tests/rpl_db_stmts_ignored.inc
85
86 --echo #
87 --echo # Cleanup
88 --echo #
89 --source include/force_restart.inc
90 --source include/rpl_end.inc