mariadb/mysql-test/suite/rpl/r/rpl_checksum_cache.result
Monty 775cba4d0f MDEV-33145 Add FLUSH GLOBAL STATUS
- FLUSH GLOBAL STATUS now resets most global_status_vars.
  At this stage, this is mainly to be used for testing.
- FLUSH SESSION STATUS added as an alias for FLUSH STATUS.
- FLUSH STATUS does not require any privilege (before required RELOAD).
- FLUSH GLOBAL STATUS requires RELOAD privilege.
- All global status reset moved to FLUSH GLOBAL STATUS.
- Replication semisync status variables are now reset by
  FLUSH GLOBAL STATUS.
- In test cases, the only changes are:
  - Replace FLUSH STATUS with FLUSH GLOBAL STATUS
  - Replace FLUSH STATUS with FLUSH STATUS; FLUSH GLOBAL STATUS.
    This was only done in a few tests where the test was using SHOW STATUS
    for both local and global variables.
- Uptime_since_flush_status is now always provided, independent if
  ENABLED_PROFILING is enabled when compiling MariaDB.
- @@global.Uptime_since_flush_status is reset on FLUSH GLOBAL STATUS
  and @@session.Uptime_since_flush_status is reset on FLUSH SESSION STATUS.
- When connected, @@session.Uptime_since_flush_status is set to 0.
2024-05-27 12:39:03 +02:00

177 lines
5.1 KiB
Text

include/master-slave.inc
[connection master]
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.*");
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 .*");
connection master;
set @save_binlog_cache_size = @@global.binlog_cache_size;
set @save_binlog_checksum = @@global.binlog_checksum;
set @save_master_verify_checksum = @@global.master_verify_checksum;
set @@global.binlog_cache_size = 4096;
set @@global.binlog_checksum = CRC32;
set @@global.master_verify_checksum = 1;
connection slave;
include/stop_slave.inc
include/start_slave.inc
connection master;
flush global status;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 0
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 0
drop table if exists t1;
create table t1 (a int PRIMARY KEY, b CHAR(32)) engine=innodb;
create procedure test.p_init (n int, size int)
begin
while n > 0 do
select round(RAND() * size) into @act_size;
set @data = repeat('a', @act_size);
insert into t1 values(n, @data );
set n= n-1;
end while;
end|
begin;
call test.p_init(4000, 32);
commit;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 1
*** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
connection master;
begin;
delete from t1;
commit;
connection slave;
connection master;
flush global status;
create table t2(a int auto_increment primary key, data VARCHAR(12288)) ENGINE=Innodb;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 1
*** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
connection slave;
include/diff_tables.inc [master:test.t2, slave:test.t2]
connection master;
begin;
delete from t2;
commit;
connection slave;
connection master;
flush global status;
create table t3(a int auto_increment primary key, data VARCHAR(8192)) engine=innodb;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 1
*** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
connection slave;
include/diff_tables.inc [master:test.t3, slave:test.t3]
connection master;
begin;
delete from t3;
commit;
connection slave;
connection master;
flush global status;
create procedure test.p1 (n int)
begin
while n > 0 do
case (select (round(rand()*100) % 3) + 1)
when 1 then
select round(RAND() * 32) into @act_size;
set @data = repeat('a', @act_size);
insert into t1 values(n, @data);
when 2 then
begin
select round(8192 + RAND() * 4096) into @act_size;
insert into t2 set data=repeat('a', @act_size);
end;
when 3 then
begin
select round(3686.4000 + RAND() * 819.2000) into @act_size;
insert into t3 set data= repeat('a', @act_size);
end;
end case;
set n= n-1;
end while;
end|
set autocommit= 0;
begin;
call test.p1(1000);
commit;
show status like "binlog_cache_use";
Variable_name Value
Binlog_cache_use 1
*** binlog_cache_disk_use must be non-zero ***
show status like "binlog_cache_disk_use";
Variable_name Value
Binlog_cache_disk_use 1
connection slave;
include/diff_tables.inc [master:test.t1, slave:test.t1]
include/diff_tables.inc [master:test.t2, slave:test.t2]
include/diff_tables.inc [master:test.t3, slave:test.t3]
*** Test switching checksum algorithm while ongoing transactions have pre-computed checksum in their binlog cache ***
connection master;
CREATE TABLE t4 (a INT, b INT, c VARCHAR(1024), PRIMARY KEY (a,b)) ENGINE=InnoDB;
BEGIN;
INSERT INTO t4 VALUES (1, 1, "small, pre-computed checksums");
connection server_1;
BEGIN;
INSERT INTO t4 VALUES (2, 1, "big, pre-computed checksums");
set @@global.binlog_checksum = NONE;
connection master;
INSERT INTO t4 VALUES (1, 2, "done");
COMMIT;
connection server_1;
INSERT INTO t4 VALUES (2, 22, "done");
COMMIT;
connection master;
BEGIN;
INSERT INTO t4 VALUES (3, 1, "small, no pre-computed checksums");
connection server_1;
BEGIN;
INSERT INTO t4 VALUES (4, 1, "big, no pre-computed checksums");
set @@global.binlog_checksum = CRC32;
connection master;
INSERT INTO t4 VALUES (3, 2, "done");
COMMIT;
connection server_1;
INSERT INTO t4 VALUES (4, 22, "done");
COMMIT;
connection slave;
*** Test the --binlog-legacy-event-pos option.
connection master;
FLUSH BINARY LOGS;
BEGIN;
INSERT INTO t4 VALUES (5, 1, "Zero end_log_pos");
COMMIT;
set @@global.binlog_legacy_event_pos= 1;
BEGIN;
INSERT INTO t4 VALUES (6, 1, "Non-zero end_log_pos");
COMMIT;
set @@global.binlog_legacy_event_pos= 0;
connection slave;
connection master;
begin;
delete from t1;
delete from t2;
delete from t3;
commit;
drop table t1, t2, t3, t4;
set @@global.binlog_cache_size = @save_binlog_cache_size;
set @@global.binlog_checksum = @save_binlog_checksum;
set @@global.master_verify_checksum = @save_master_verify_checksum;
drop procedure test.p_init;
drop procedure test.p1;
include/rpl_end.inc