Commit 796486d1 authored by Marko Mäkelä's avatar Marko Mäkelä

MDEV-19485: Add a test case

The bug was introduced in MariaDB 10.4.0 by
commit 0e5a4ac2
but it is good to have a regression test for this scenario
in all applicable MariaDB versions.

Cover the purge of an undo log record that was written before
the completion of ADD SPATIAL INDEX.
parent c4140721
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (g MULTIPOINT NOT NULL) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('');
connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1;
ALTER TABLE t1 ADD SPATIAL INDEX (g);
disconnect purge_control;
InnoDB 0 transactions not purged
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
--source include/have_innodb.inc
SET @saved_frequency = @@GLOBAL.innodb_purge_rseg_truncate_frequency;
SET GLOBAL innodb_purge_rseg_truncate_frequency = 1;
CREATE TABLE t1 (g MULTIPOINT NOT NULL) ENGINE=InnoDB;
INSERT INTO t1 VALUES ('');
connect purge_control,localhost,root;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
DELETE FROM t1;
ALTER TABLE t1 ADD SPATIAL INDEX (g);
disconnect purge_control;
--source ../../innodb/include/wait_all_purged.inc
DROP TABLE t1;
SET GLOBAL innodb_purge_rseg_truncate_frequency = @saved_frequency;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment