mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Bug #39918 memory (heap) engine crashing with b-tree index and DELETE
with seg fault Multiple-table DELETE from a table joined to itself may cause server crash. This was originally discovered with MEMORY engine, but may affect other engines with different symptoms. The problem was that the server violated SE API by performing parallel table scan in one handler and removing records in another (delete on the fly optimization). mysql-test/r/heap_btree.result: Updated test result after adding new test for this bug. mysql-test/t/heap_btree.test: Updated test result after adding new test for the bug report. sql/sql_delete.cc: Updated to check if the files in delete list appears in join list and disable delete while scanning, if it appears.
This commit is contained in:
@ -336,4 +336,11 @@ a b
|
||||
NULL NULL
|
||||
NULL 1
|
||||
drop table t1;
|
||||
#
|
||||
# bug#39918 - memory (heap) engine crashing while executing self join with delete
|
||||
#
|
||||
CREATE TABLE t1(a INT, KEY USING BTREE (a)) ENGINE=MEMORY;
|
||||
INSERT INTO t1 VALUES(1),(1);
|
||||
DELETE a1 FROM t1 AS a1, t1 AS a2 WHERE a1.a=a2.a;
|
||||
DROP TABLE t1;
|
||||
End of 5.0 tests
|
||||
|
@ -253,5 +253,13 @@ insert into t1 values (1, 1), (3, 3), (2, 2), (NULL, 1), (NULL, NULL), (0, 0);
|
||||
select * from t1 where a is null;
|
||||
drop table t1;
|
||||
|
||||
-- echo #
|
||||
-- echo # bug#39918 - memory (heap) engine crashing while executing self join with delete
|
||||
-- echo #
|
||||
|
||||
CREATE TABLE t1(a INT, KEY USING BTREE (a)) ENGINE=MEMORY;
|
||||
INSERT INTO t1 VALUES(1),(1);
|
||||
DELETE a1 FROM t1 AS a1, t1 AS a2 WHERE a1.a=a2.a;
|
||||
DROP TABLE t1;
|
||||
--echo End of 5.0 tests
|
||||
|
||||
|
Reference in New Issue
Block a user