mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-30 19:03:16 +03:00
Fix assert() statements that would (incorrectly) fire if an IF NOT EXISTS
trigger that already exists contained two or more RETURNING clauses. Tickets [89d259d45b855a0d] and [d15b3a4ea901ef0d]. FossilOrigin-Name: 648899e4ded72cac6cc24bccf7ebfc709ee7309a003452b21fd6ab0ba20c34b8
This commit is contained in:
@ -419,4 +419,23 @@ do_catchsql_test 18.1 {
|
||||
INSERT INTO view_2 DEFAULT VALUES RETURNING *;
|
||||
} {1 {no such collation sequence: TRUE}}
|
||||
|
||||
# 2023-03-16
|
||||
# https://sqlite.org/forum/forumpost/c99d6e0329
|
||||
# ticket d15b3a4ea901ef0d
|
||||
# ticket 89d259d45b855a0d
|
||||
#
|
||||
# A RETURNING clause on an IF NOT EXISTS trigger does not generate
|
||||
# an error if the trigger already exists.
|
||||
#
|
||||
do_execsql_test 19.0 {
|
||||
DROP TABLE IF EXISTS t1;CREATE TABLE t1(a);
|
||||
CREATE TRIGGER r1 AFTER UPDATE ON t1 BEGIN VALUES(0); END;
|
||||
} {}
|
||||
do_catchsql_test 19.1 {
|
||||
CREATE TRIGGER IF NOT EXISTS r1 AFTER DELETE ON t1 BEGIN
|
||||
INSERT INTO t1(a) VALUES (1) RETURNING FALSE;
|
||||
INSERT INTO t1(a) VALUES (2) RETURNING TRUE;
|
||||
END;
|
||||
} {0 {}}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user