mariadb/mysql-test/suite/innodb/t/page_cleaner.test
Marko Mäkelä 1756b0f37d MDEV-35813: more robust test case
Let us integrate the test case with innodb.page_cleaner so that there
will be less interference from log writes due to checkpoints.
Also, make the test compatible with ./mtr --cursor-protocol.
2025-03-18 10:41:38 +02:00

56 lines
1.9 KiB
Text

--source include/have_innodb.inc
--source include/have_sequence.inc
SET @save_pct= @@GLOBAL.innodb_max_dirty_pages_pct;
SET @save_pct_lwm= @@GLOBAL.innodb_max_dirty_pages_pct_lwm;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0.0;
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
CREATE TABLE t(a INT PRIMARY KEY) ENGINE=InnoDB STATS_PERSISTENT=0;
--connect (prevent_purge,localhost,root)
START TRANSACTION WITH CONSISTENT SNAPSHOT;
--connection default
SET GLOBAL innodb_max_purge_lag_wait=0;
let $wait_condition =
SELECT variable_value = 0
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_max_dirty_pages_pct=90.0;
--disable_cursor_protocol
SELECT variable_value INTO @log_writes FROM information_schema.global_status
WHERE variable_name='innodb_log_writes';
--enable_cursor_protocol
BEGIN;
INSERT INTO t SELECT * FROM seq_1_to_500;
INSERT INTO t SELECT * FROM seq_501_to_1000;
INSERT INTO t SELECT * FROM seq_1001_to_1500;
INSERT INTO t SELECT * FROM seq_1501_to_2000;
INSERT INTO t SELECT * FROM seq_2001_to_2500;
INSERT INTO t SELECT * FROM seq_2501_to_3000;
INSERT INTO t SELECT * FROM seq_3001_to_3500;
INSERT INTO t SELECT * FROM seq_3501_to_4000;
INSERT INTO t SELECT * FROM seq_4001_to_4500;
INSERT INTO t SELECT * FROM seq_4501_to_5000;
ROLLBACK;
SELECT if(variable_value-@log_writes<10,'ok',variable_value-@log_writes)
FROM information_schema.global_status WHERE variable_name='innodb_log_writes';
--disconnect prevent_purge
SELECT variable_value>0 FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
SET GLOBAL innodb_max_dirty_pages_pct=0.0;
# Without the MDEV-24917 fix, we would time out here.
--source include/wait_condition.inc
DROP TABLE t;
SET GLOBAL innodb_max_dirty_pages_pct = @save_pct;
SET GLOBAL innodb_max_dirty_pages_pct_lwm = @save_pct_lwm;