From 42f09adab68f80fb99d6da0413cd4983ec13f5ab Mon Sep 17 00:00:00 2001 From: Monty Date: Thu, 30 Aug 2018 13:45:27 +0300 Subject: [PATCH] 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. --- mysql-test/suite/maria/maria.result | 4 ++++ mysql-test/suite/maria/maria.test | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/mysql-test/suite/maria/maria.result b/mysql-test/suite/maria/maria.result index 2aca47538cbf2..1cf48b0628d66 100644 --- a/mysql-test/suite/maria/maria.result +++ b/mysql-test/suite/maria/maria.result @@ -2723,6 +2723,10 @@ id name -1 dog 2 cat DROP TABLE t1; +CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria; +INSERT INTO t1 VALUES (1,2), (2,3),(3,4); +DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk); +DROP TABLE t1; # # End of 5.5 tests # diff --git a/mysql-test/suite/maria/maria.test b/mysql-test/suite/maria/maria.test index ab8e72dc32113..954bd15744eb7 100644 --- a/mysql-test/suite/maria/maria.test +++ b/mysql-test/suite/maria/maria.test @@ -2012,6 +2012,16 @@ INSERT INTO t1 (name) VALUES ('cat'); SELECT * FROM t1; DROP TABLE t1; +# +# MDEV-16682 +# Assertion `(buff[7] & 7) == HEAD_PAGE' failed. +# + +CREATE TABLE t1 (pk int, i2 int) ENGINE=Aria; +INSERT INTO t1 VALUES (1,2), (2,3),(3,4); +DELETE FROM tt.*, t1.* USING t1 AS tt LEFT JOIN t1 ON (tt.i2 = t1.pk); +DROP TABLE t1; + --echo # --echo # End of 5.5 tests --echo #