Debian Codegraph @

mysql-test/suite/rpl/r/rpl_checksum_cache.result

raw
1 include/master-slave.inc
2 [connection master]
3 call mtr.add_suppression("Unsafe statement written to the binary log using statement format since BINLOG_FORMAT = STATEMENT. .*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: insert into t1 values.* NAME_CONST.*'n',.*, @data .*");
5 connection master;
6 set @save_binlog_cache_size = @@global.binlog_cache_size;
7 set @save_binlog_checksum = @@global.binlog_checksum;
8 set @save_master_verify_checksum = @@global.master_verify_checksum;
9 set @@global.binlog_cache_size = 4096;
10 set @@global.binlog_checksum = CRC32;
11 set @@global.master_verify_checksum = 1;
12 connection slave;
13 include/stop_slave.inc
14 include/start_slave.inc
15 connection master;
16 flush global status;
17 show status like "binlog_cache_use";
18 Variable_name Value
19 Binlog_cache_use 0
20 show status like "binlog_cache_disk_use";
21 Variable_name Value
22 Binlog_cache_disk_use 0
23 drop table if exists t1;
24 create table t1 (a int PRIMARY KEY, b CHAR(32)) engine=innodb;
25 create procedure test.p_init (n int, size int)
26 begin
27 while n > 0 do
28 select round(RAND() * size) into @act_size;
29 set @data = repeat('a', @act_size);
30 insert into t1 values(n, @data );
31 set n= n-1;
32 end while;
33 end|
34 begin;
35 call test.p_init(4000, 32);
36 commit;
37 show status like "binlog_cache_use";
38 Variable_name Value
39 Binlog_cache_use 1
40 *** binlog_cache_disk_use must be non-zero ***
41 show status like "binlog_cache_disk_use";
42 Variable_name Value
43 Binlog_cache_disk_use 1
44 connection slave;
45 include/diff_tables.inc [master:test.t1, slave:test.t1]
46 connection master;
47 begin;
48 delete from t1;
49 commit;
50 connection slave;
51 connection master;
52 flush global status;
53 create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb;
54 show status like "binlog_cache_use";
55 Variable_name Value
56 Binlog_cache_use 1
57 *** binlog_cache_disk_use must be non-zero ***
58 show status like "binlog_cache_disk_use";
59 Variable_name Value
60 Binlog_cache_disk_use 1
61 connection slave;
62 include/diff_tables.inc [master:test.t2, slave:test.t2]
63 connection master;
64 begin;
65 delete from t2;
66 commit;
67 connection slave;
68 connection master;
69 flush global status;
70 create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb;
71 show status like "binlog_cache_use";
72 Variable_name Value
73 Binlog_cache_use 1
74 *** binlog_cache_disk_use must be non-zero ***
75 show status like "binlog_cache_disk_use";
76 Variable_name Value
77 Binlog_cache_disk_use 1
78 connection slave;
79 include/diff_tables.inc [master:test.t3, slave:test.t3]
80 connection master;
81 begin;
82 delete from t3;
83 commit;
84 connection slave;
85 connection master;
86 flush global status;
87 create procedure test.p1 (n int)
88 begin
89 while n > 0 do
90 case (select (round(rand()*100) % 3) + 1)
91 when 1 then
92 select round(RAND() * 32) into @act_size;
93 set @data = repeat('a', @act_size);
94 insert into t1 values(n, @data);
95 when 2 then
96 begin
97 select round(8192 + RAND() * 4096) into @act_size;
98 insert into t2 set data=repeat('a', @act_size);
99 end;
100 when 3 then
101 begin
102 select round(3686.4000 + RAND() * 819.2000) into @act_size;
103 insert into t3 set data= repeat('a', @act_size);
104 end;
105 end case;
106 set n= n-1;
107 end while;
108 end|
109 set autocommit= 0;
110 begin;
111 call test.p1(1000);
112 commit;
113 show status like "binlog_cache_use";
114 Variable_name Value
115 Binlog_cache_use 1
116 *** binlog_cache_disk_use must be non-zero ***
117 show status like "binlog_cache_disk_use";
118 Variable_name Value
119 Binlog_cache_disk_use 1
120 connection slave;
121 include/diff_tables.inc [master:test.t1, slave:test.t1]
122 include/diff_tables.inc [master:test.t2, slave:test.t2]
123 include/diff_tables.inc [master:test.t3, slave:test.t3]
124 *** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache ***
125 connection master;
126 CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB;
127 BEGIN;
128 INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums");
129 connection server_1;
130 BEGIN;
131 INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums");
132 set @@global.binlog_checksum = NONE;
133 connection master;
134 INSERT INTO t4 VALUES (1, 2, "done");
135 COMMIT;
136 connection server_1;
137 INSERT INTO t4 VALUES (2, 22, "done");
138 COMMIT;
139 connection master;
140 BEGIN;
141 INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums");
142 connection server_1;
143 BEGIN;
144 INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums");
145 set @@global.binlog_checksum = CRC32;
146 connection master;
147 INSERT INTO t4 VALUES (3, 2, "done");
148 COMMIT;
149 connection server_1;
150 INSERT INTO t4 VALUES (4, 22, "done");
151 COMMIT;
152 connection slave;
153 *** Test the --binlog-legacy-event-pos option.
154 connection master;
155 FLUSH BINARY LOGS;
156 BEGIN;
157 INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos");
158 COMMIT;
159 set @@global.binlog_legacy_event_pos= 1;
160 BEGIN;
161 INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos");
162 COMMIT;
163 set @@global.binlog_legacy_event_pos= 0;
164 connection slave;
165 connection master;
166 begin;
167 delete from t1;
168 delete from t2;
169 delete from t3;
170 commit;
171 drop table t1, t2, t3, t4;
172 set @@global.binlog_cache_size = @save_binlog_cache_size;
173 set @@global.binlog_checksum = @save_binlog_checksum;
174 set @@global.master_verify_checksum = @save_master_verify_checksum;
175 drop procedure test.p_init;
176 drop procedure test.p1;
177 include/rpl_end.inc