mirror of
https://github.com/MariaDB/server.git
synced 2025-12-24 11:21:21 +03:00
BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage engine
An update that used a join of a table to itself and modified the table on one side of the join reported the table as crashed or updated wrong rows. Fixed by creating temporary table for self-joined multi update statement.
This commit is contained in:
@@ -890,4 +890,23 @@ connection default;
|
||||
select * from t1;
|
||||
drop table t1;
|
||||
|
||||
#
|
||||
# BUG#21310 - Trees in SQL causing a "crashed" table with MyISAM storage
|
||||
# engine
|
||||
#
|
||||
|
||||
# A simplified test case that reflect crashed table issue.
|
||||
CREATE TABLE t1(a VARCHAR(16));
|
||||
INSERT INTO t1 VALUES('aaaaaaaa'),(NULL);
|
||||
UPDATE t1 AS ta1, t1 AS ta2 SET ta1.a='aaaaaaaaaaaaaaaa';
|
||||
SELECT * FROM t1;
|
||||
DROP TABLE t1;
|
||||
|
||||
# A test case that reflect wrong result set.
|
||||
CREATE TABLE t1(a INT);
|
||||
INSERT INTO t1 VALUES(1),(2);
|
||||
UPDATE t1,t1 AS t2 SET t1.a=t1.a+2 WHERE t1.a=t2.a-1;
|
||||
SELECT * FROM t1 ORDER BY a;
|
||||
DROP TABLE t1;
|
||||
|
||||
# End of 4.1 tests
|
||||
|
||||
Reference in New Issue
Block a user