Debian Codegraph @

mysql-test/suite/perfschema/include/binlog_ok_common.inc

raw
1 # Test replication, when using special non-replicated tables.
2 #
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
8 # - ROW binlog format.
9
10 RESET MASTER;
11
12 --disable_warnings
13 drop database if exists my_local_db;
14 --enable_warnings
15
16 create database my_local_db;
17
18 create table my_local_db.my_tx_table(a bigint) engine = innodb;
19
20 use test;
21 drop table if exists marker_start;
22
23 # --binlog-ignore-db only works with the current database.
24 use my_local_db;
25
26 insert into my_tx_table(a)
27 values (1000), (2000), (3000);
28
29 use test;
30 drop table if exists marker_truncate;
31
32 use performance_schema;
33 truncate table events_waits_history;
34 truncate table events_waits_history_long;
35
36 use test;
37 truncate table performance_schema.events_statements_history_long;
38 truncate table performance_schema.host_cache;
39
40 use test;
41 drop table if exists marker_update;
42
43 use performance_schema;
44 update setup_instruments set enabled='NO';
45 update setup_instruments set timed='NO';
46 use test;
47 update performance_schema.setup_instruments set enabled='YES', timed='YES';
48 update performance_schema.threads set instrumented='YES';
49
50 use test;
51 drop table if exists marker_insert;
52
53 insert into performance_schema.setup_actors(`user`, `host`, `role`)
54 values ('XXX', 'XXX', 'XXX'),
55 ('YYY', 'YYY', 'YYY'),
56 ('ZZZ', 'ZZZ', 'ZZZ');
57
58 select * from performance_schema.setup_actors
59 where user in ('XXX', 'YYY', 'ZZZ') order by user;
60
61 insert into performance_schema.setup_objects
62 (object_type, object_schema, object_name, enabled, timed)
63 values ('TABLE', 'db1', 'aaa', 'YES', 'YES'),
64 ('TABLE', 'db1', 'bbb', 'NO', 'NO'),
65 ('TABLE', 'db2', 'ccc', 'YES', 'NO'),
66 ('TABLE', 'db2', 'ddd', 'NO', 'YES');
67
68 select * from performance_schema.setup_objects
69 where object_schema like 'db%' order by object_name;
70
71 use test;
72 drop table if exists marker_insert_select;
73
74 # Note:
75 # The queries used here do not make any sense (no semantic).
76 # What this test is interested in, is check the behavior
77 # when replicating queries that mix both:
78 # - non replicated tables
79 # - replicated tables
80
81 use my_local_db;
82 insert into my_tx_table(a)
83 select thread_id from performance_schema.threads;
84
85 insert into my_tx_table(a)
86 select id from information_schema.processlist;
87
88 insert into my_tx_table(a)
89 select thread_id from mysql.general_log;
90
91 insert into my_tx_table(a)
92 select thread_id from mysql.slow_log;
93
94 insert into my_tx_table(a)
95 select Relay_log_pos from mysql.slave_relay_log_info;
96
97 insert into my_tx_table(a)
98 select Master_log_pos from mysql.slave_master_info;
99
100 insert into my_tx_table(a)
101 select Relay_log_pos from mysql.slave_worker_info;
102
103 use test;
104 drop table if exists marker_delete;
105
106 delete from performance_schema.setup_actors
107 where user in ('XXX', 'YYY', 'ZZZ');
108
109 delete from performance_schema.setup_objects
110 where object_schema like 'DB%';
111
112 use test;
113 drop table if exists marker_end;
114
115 drop database my_local_db;
116
117 # The content of the binlog dumped in the result file
118 # should not contain any references to non-replicated tables.
119
120 --source include/show_binlog_events.inc
121