1
include/master-slave.inc
3
CALL mtr.add_suppression("Unsafe statement binlogged in statement format since BINLOG_FORMAT = STATEMENT");
5
SET @old_log_output= @@log_output;
6
SET GLOBAL log_output= 'TABLE';
7
SET @old_long_query_time= @@long_query_time;
8
SET GLOBAL long_query_time= 2;
9
TRUNCATE mysql.slow_log;
10
include/start_slave.inc
11
CREATE TABLE t1 (a int, b int);
12
INSERT INTO t1 values(1, 1);
13
INSERT INTO t1 values(1, sleep(3));
14
TRUNCATE mysql.slow_log;
21
TRUNCATE mysql.slow_log;
29
TRUNCATE mysql.slow_log;
30
SET @old_slow_query_log= @@slow_query_log;
31
SET GLOBAL slow_query_log= 'OFF';
38
TRUNCATE mysql.slow_log;
39
SET GLOBAL slow_query_log= @old_slow_query_log;
41
include/stop_slave.inc
42
SET GLOBAL long_query_time= @old_long_query_time;
43
SET GLOBAL log_output= @old_log_output;
44
include/start_slave.inc
46
SET @old_log_output= @@log_output;
47
SET GLOBAL log_output= 'TABLE';
48
SET GLOBAL long_query_time= 2;
49
SET @old_long_query_time= @@long_query_time;
50
SET SESSION long_query_time= 2;
51
TRUNCATE mysql.slow_log;
52
include/stop_slave.inc
53
SET @old_log_output= @@log_output;
54
SET GLOBAL log_output= 'TABLE';
55
SET @old_long_query_time= @@long_query_time;
56
SET GLOBAL long_query_time= 2;
57
TRUNCATE mysql.slow_log;
58
include/start_slave.inc
59
CREATE TABLE t1 (a int, b int);
60
********************************************************************
61
**** INSERT one row that exceeds long_query_time
62
**** Outcome: query ends up in both master and slave slow log
63
********************************************************************
64
INSERT INTO t1 values(1, sleep(3));
65
### Assertion is good. Both Master and Slave exhibit the
66
### same number of queries in slow log: 1
67
TRUNCATE mysql.slow_log;
68
TRUNCATE mysql.slow_log;
69
********************************************************************
70
**** Now do inserts again, but first add an index to the table.
71
**** Outcome: Note that the slave contains the same one entry (as
72
**** the master does) whereas before the patch it did not.
73
********************************************************************
74
ALTER TABLE t1 ADD INDEX id1(a);
75
INSERT INTO t1 values(1, sleep(3));
76
### Assertion is good. Both Master and Slave exhibit the
77
### same number of queries in slow log: 1
78
SET @@global.log_output= @old_log_output;
79
SET @@global.long_query_time= @old_long_query_time;
81
SET @@global.log_output= @old_log_output;
82
SET @@global.long_query_time= @old_long_query_time;