1 # Test replication, when using special non-replicated tables.
3 # This test involve special statements that use non-replicated tables.
4 # Changes affecting non replicated tables are never written to the binlog.
5 # Executing these statements should work nicely with replication in all cases:
6 # - STATEMENT binlog format
7 # - MIXED binlog format
13 drop database
if exists my_local_db;
16 create database my_local_db;
18 create
table my_local_db.my_tx_table(a bigint) engine = innodb;
19 create
table my_local_db.my_non_tx_table(a bigint) engine = myisam;
22 drop
table if exists marker_start;
24 # --binlog-ignore-db only works with the current database.
27 insert into my_tx_table(a)
28 values (1000), (2000), (3000);
30 insert into my_non_tx_table(a)
31 values (1000), (2000), (3000);
34 drop
table if exists marker_truncate;
36 use performance_schema;
37 truncate
table events_waits_history;
38 truncate
table events_waits_history_long;
41 truncate
table performance_schema.events_statements_history_long;
42 truncate
table performance_schema.host_cache;
45 drop
table if exists marker_update;
47 use performance_schema;
48 update setup_instruments set enabled='NO';
49 update setup_instruments set timed='NO';
51 update performance_schema.setup_instruments set enabled='YES', timed='YES';
52 update performance_schema.threads set instrumented='YES';
55 drop
table if exists marker_insert;
57 insert into performance_schema.setup_actors(`user`, `host`, `role`)
58 values ('XXX', 'XXX', 'XXX'),
59 ('YYY', 'YYY', 'YYY'),
60 ('ZZZ', 'ZZZ', 'ZZZ');
62 select * from performance_schema.setup_actors
63 where user in ('XXX', 'YYY', 'ZZZ') order by user;
65 insert into performance_schema.setup_objects
66 (object_type, object_schema, object_name, enabled, timed)
67 values ('
TABLE', 'DB1', 'AAA', 'YES', 'YES'),
68 ('TABLE', 'DB1', 'BBB', 'NO', 'NO'),
69 ('TABLE', 'DB2', 'CCC', 'YES', 'NO'),
70 ('TABLE', 'DB2', 'DDD', 'NO', 'YES');
72 select * from performance_schema.setup_objects
73 where object_schema like 'DB%' order by object_name;
76 drop
table if exists marker_insert_select;
79 # The queries used here do not make any sense (no semantic).
80 # What this test is interrested in, is check the behavior
81 # when replicating queries that mix both:
82 # - non replicated tables
86 insert into my_tx_table(a)
87 select thread_id from performance_schema.threads;
89 insert into my_non_tx_table(a)
90 select thread_id from performance_schema.threads;
92 insert into my_tx_table(a)
93 select
id from information_schema.processlist;
95 insert into my_non_tx_table(a)
96 select
id from information_schema.processlist;
98 insert into my_tx_table(a)
99 select thread_id from mysql.general_log;
101 insert into my_non_tx_table(a)
102 select thread_id from mysql.general_log;
104 insert into my_tx_table(a)
105 select thread_id from mysql.slow_log;
107 insert into my_non_tx_table(a)
108 select thread_id from mysql.slow_log;
110 insert into my_tx_table(a)
111 select Relay_log_pos from mysql.slave_relay_log_info;
113 insert into my_non_tx_table(a)
114 select Relay_log_pos from mysql.slave_relay_log_info;
116 insert into my_tx_table(a)
117 select Master_log_pos from mysql.slave_master_info;
119 insert into my_non_tx_table(a)
120 select Master_log_pos from mysql.slave_master_info;
122 insert into my_tx_table(a)
123 select Relay_log_pos from mysql.slave_worker_info;
125 insert into my_non_tx_table(a)
126 select Relay_log_pos from mysql.slave_worker_info;
129 drop
table if exists marker_delete;
131 delete from performance_schema.setup_actors
132 where user in ('XXX', 'YYY', 'ZZZ');
134 delete from performance_schema.setup_objects
135 where object_schema like 'DB%';
138 drop
table if exists marker_end;
140 drop database my_local_db;
142 # The content of the binlog dumped in the result file
143 # should not contain any references to non-replicated tables.
145 --source include/show_binlog_events.inc