mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-32086 (part 2) Server crash when inserting from derived table containing insert target table
Get rid of need of matherialization for usual INSERT (cache results in Item_cache* if needed) - subqueries in VALUE do not see new records in the table we are inserting to - subqueries in RETIRNING prohibited to use the table we are inserting to
This commit is contained in:
@@ -498,6 +498,8 @@ t1 WHERE id1=1)
|
||||
5 6
|
||||
INSERT INTO t2(id2,val2) VALUES(5,'f') RETURNING (SELECT id2 FROM t2);
|
||||
ERROR HY000: Table 't2' is specified twice, both as a target for 'INSERT' and as a separate source for data
|
||||
INSERT INTO t2(id2,val2) VALUES(5,'f') RETURNING (SELECT 1 UNION SELECT id2 FROM t2);
|
||||
ERROR HY000: Table 't2' is specified twice, both as a target for 'INSERT' and as a separate source for data
|
||||
INSERT INTO t2 (id2, val2) VALUES (6,'f') RETURNING t1.*;
|
||||
ERROR 42S02: Unknown table 'test.t1'
|
||||
#
|
||||
|
Reference in New Issue
Block a user