Skip to content

Commit 42f09ad

Browse files
committed
MDEV-16682 Assertion `(buff[7] & 7) == HEAD_PAGE' failed
Problem was that SQL level tried to read a record with rnd_pos() that was already deleted by the same statement. In the case where the page for the record had been deleted, this caused an assert. Fixed by extending the assert to also handle empty pages and return HA_ERR_RECORD_DELETED for reads to deleted pages.
1 parent e560f2f commit 42f09ad

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

mysql-test/suite/maria/maria.result

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2723,6 +2723,10 @@ id name
27232723
-1 dog
27242724
2 cat
27252725
DROP TABLE t1;
2726+
CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria;
2727+
INSERT INTO t1 VALUES (1,2), (2,3),(3,4);
2728+
DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk);
2729+
DROP TABLE t1;
27262730
#
27272731
# End of 5.5 tests
27282732
#

mysql-test/suite/maria/maria.test

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2012,6 +2012,16 @@ INSERT INTO t1 (name) VALUES ('cat');
20122012
SELECT * FROM t1;
20132013
DROP TABLE t1;
20142014

2015+
#
2016+
# MDEV-16682
2017+
# Assertion `(buff[7] & 7) == HEAD_PAGE' failed.
2018+
#
2019+
2020+
CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria;
2021+
INSERT INTO t1 VALUES (1,2), (2,3),(3,4);
2022+
DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk);
2023+
DROP TABLE t1;
2024+
20152025
--echo #
20162026
--echo # End of 5.5 tests
20172027
--echo #

0 commit comments

Comments
 (0)