mariadb/mysql-test/suite/innodb/r/lock_secondary.result
Marko Mäkelä be0e3b2f0d MDEV-37753 lock_sec_rec_some_has_impl() unnecessarily fetches history
row_vers_impl_x_locked_low(): If a secondary index record points to
a clustered index record that carries the current transaction identifier,
then there cannot possibly be any implicit locks to that secondary index
record, because those would have been checked before the current
transaction got the implicit lock (modified the clustered index record)
in the first place.

This fix will avoid unnecessary access to undo log and possible BLOB pages,
which may already have been freed in a purge operation.

buf_page_get_zip(): Assert that the page is not marked as freed
in the tablespace. This assertion could fire in a scenario like the
test case when the table is created in ROW_FORMAT=COMPRESSED.
2025-10-08 16:34:49 +03:00

24 lines
862 B
Text

#
# MDEV-37753 lock_sec_rec_some_has_impl() unnecessarily fetches history
#
CREATE TABLE t(a INT PRIMARY KEY, b TEXT, UNIQUE(b(1)))
ENGINE=InnoDB STATS_PERSISTENT=0;
connect purge_control,localhost,root,,;
START TRANSACTION WITH CONSISTENT SNAPSHOT;
connection default;
SET GLOBAL innodb_max_purge_lag_wait=1;
INSERT INTO t VALUES
(1,REPEAT('x',@@innodb_page_size/2)),(2,REPEAT('z',@@innodb_page_size/2));
DELETE FROM t;
SELECT variable_value INTO @reads
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_READ_REQUESTS';
INSERT INTO t VALUES(0,'y'),(1,'x'),(2,'z');
SELECT variable_value-@reads INTO @diff
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_READ_REQUESTS';
SELECT if(@diff between 22 and 25,'ok',@diff);
if(@diff between 22 and 25,'ok',@diff)
ok
disconnect purge_control;
DROP TABLE t;