1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-01 06:27:03 +03:00

Raise an error if a term of the form "TABLE.*" appears in the RETURNING clause,

as SQLite does not (yet) know how to handle that.
Ticket [132994c8b1063bfb].

FossilOrigin-Name: 3039bcaff95bb5d096c80b5eefdaeda6abd1d1337e829f32fd28a968f663f481
This commit is contained in:
drh
2021-03-30 01:52:21 +00:00
parent 28a314e74d
commit 0d23f678b1
4 changed files with 44 additions and 10 deletions

View File

@ -115,4 +115,18 @@ do_execsql_test 5.5 {
UPDATE t2 SET b='123' WHERE b='abc' RETURNING (SELECT b FROM t1);
} {123}
# Ticket 132994c8b1063bfb
reset_db
do_catchsql_test 6.0 {
CREATE TABLE t1(id INTEGER PRIMARY KEY);
CREATE TABLE t2(x INT, y INT);
INSERT INTO t1 VALUES(1),(2),(4),(9);
INSERT INTO t2 VALUES(3,7), (4,25), (5,99);
UPDATE t1 SET id=id+y FROM t2 WHERE t1.id=t2.x RETURNING t2.*;
} {1 {RETURNING may not use "TABLE.*" wildcards}}
do_catchsql_test 6.1 {
UPDATE t1 SET id=id+y FROM t2 WHERE t1.id=t2.x RETURNING *, '|';
SELECT * FROM t1 ORDER BY id;
} {0 {29 | 1 2 9 29}}
finish_test