blob: 88c74bab69b08fdd3a6daadfc5b2df98529719ff (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
-- source include/have_binlog_format_statement.inc
-- source include/master-slave.inc
connection master;
-- disable_warnings
DROP TABLE IF EXISTS t;
-- enable_warnings
CREATE TABLE t(id INT);
-- disable_warnings
connection slave;
START SLAVE;
-- source include/wait_for_slave_to_start.inc
-- enable_warnings
connection master;
INSERT INTO t VALUES (1);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (2);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
connection slave;
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (3);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=OFF;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (4);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
connection slave;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (5);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
set global log_slow_slave_statements=ON;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (6);
sync_slave_with_master;
connection slave;
show variables like 'log_slow_slave_statements';
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
START SLAVE;
-- source include/wait_for_slave_to_start.inc
connection slave;
show variables like 'log_slow_slave_statements';
connection master;
INSERT INTO t VALUES (7);
sync_slave_with_master;
connection master;
FLUSH LOGS;
-- echo # Analyse master slow_query_log
let $i=7;
let $k=1;
while($i)
{
--let grep_file = $MYSQLTEST_VARDIR/mysqld.1/data/percona_log_slow_slave_statements-master.log
--let grep_pattern = INSERT INTO t VALUES \($k\)
--source grep.inc
dec $i;
inc $k;
}
connection slave;
FLUSH LOGS;
-- echo # Analyse slave slow_query_log
let $i=7;
let $k=1;
while($i)
{
--let grep_file = $MYSQLTEST_VARDIR/mysqld.2/data/percona_log_slow_slave_statements-slave.log
--let grep_pattern = INSERT INTO t VALUES \($k\)
--source grep.inc
dec $i;
inc $k;
}
set global log_slow_slave_statements=OFF;
connection master;
DROP TABLE t;
sync_slave_with_master;
STOP SLAVE;
-- source include/wait_for_slave_to_stop.inc
|