1
include/master-slave.inc
3
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t2 set data=repeat.*'a', @act_size.*");
4
call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. Statement is unsafe because it uses a system function that may return a different value on the slave. Statement: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
5
set @save_binlog_cache_size = @@global.binlog_cache_size;
6
set @save_binlog_checksum = @@global.binlog_checksum;
7
set @save_master_verify_checksum = @@global.master_verify_checksum;
8
set @@global.binlog_cache_size = 4096;
9
set @@global.binlog_checksum = CRC32;
10
set @@global.master_verify_checksum = 1;
11
include/stop_slave.inc
12
include/start_slave.inc
14
show status like "binlog_cache_use";
17
show status like "binlog_cache_disk_use";
19
Binlog_cache_disk_use 0
20
drop table if exists t1;
21
create table t1 (a int PRIMARY KEY, b CHAR(32)) engine=innodb;
22
create procedure test.p_init (n int, size int)
25
select round(RAND() * size) into @act_size;
26
set @data = repeat('a', @act_size);
27
insert into t1 values(n, @data );
32
call test.p_init(4000, 32);
34
show status like "binlog_cache_use";
37
*** binlog_cache_disk_use must be non-zero ***
38
show status like "binlog_cache_disk_use";
40
Binlog_cache_disk_use 1
41
include/diff_tables.inc [master:test.t1, slave:test.t1]
46
create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb;
47
show status like "binlog_cache_use";
50
*** binlog_cache_disk_use must be non-zero ***
51
show status like "binlog_cache_disk_use";
53
Binlog_cache_disk_use 1
54
include/diff_tables.inc [master:test.t2, slave:test.t2]
59
create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb;
60
show status like "binlog_cache_use";
63
*** binlog_cache_disk_use must be non-zero ***
64
show status like "binlog_cache_disk_use";
66
Binlog_cache_disk_use 1
67
include/diff_tables.inc [master:test.t3, slave:test.t3]
72
create procedure test.p1 (n int)
75
case (select (round(rand()*100) % 3) + 1)
77
select round(RAND() * 32) into @act_size;
78
set @data = repeat('a', @act_size);
79
insert into t1 values(n, @data);
82
select round(8192 + RAND() * 4096) into @act_size;
83
insert into t2 set data=repeat('a', @act_size);
87
select round(3686.4000 + RAND() * 819.2000) into @act_size;
88
insert into t3 set data= repeat('a', @act_size);
98
show status like "binlog_cache_use";
101
*** binlog_cache_disk_use must be non-zero ***
102
show status like "binlog_cache_disk_use";
104
Binlog_cache_disk_use 1
105
include/diff_tables.inc [master:test.t1, slave:test.t1]
106
include/diff_tables.inc [master:test.t2, slave:test.t2]
107
include/diff_tables.inc [master:test.t3, slave:test.t3]
113
drop table t1, t2, t3;
114
set @@global.binlog_cache_size = @save_binlog_cache_size;
115
set @@global.binlog_checksum = @save_binlog_checksum;
116
set @@global.master_verify_checksum = @save_master_verify_checksum;
117
drop procedure test.p_init;
118
drop procedure test.p1;