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

If an UPSERT can cause an Abort due to a constraint failure, make sure

the query planner knows this.  Ticket [7c13db5c3bf74001].

FossilOrigin-Name: f14ce948662f3445a06d84d4f32d9b81143e0cffaf773d8aa4d3a609bfb9682b
This commit is contained in:
drh
2019-12-26 23:40:33 +00:00
parent d3ee3ad12f
commit fe2a3f1d24
4 changed files with 17 additions and 8 deletions

View File

@ -233,4 +233,12 @@ do_catchsql_test upsert1-910 {
INSERT INTO t1 VALUES(3) ON CONFLICT(x) DO NOTHING;
} {1 {cannot UPSERT a view}}
# 2019-12-26 ticket 7c13db5c3bf74001
reset_db
do_catchsql_test upsert1-1000 {
CREATE TABLE t0(c0 PRIMARY KEY, c1, c2 UNIQUE) WITHOUT ROWID;
INSERT OR FAIL INTO t0(c2) VALUES (0), (NULL)
ON CONFLICT(c2) DO UPDATE SET c1 = c0;
} {1 {NOT NULL constraint failed: t0.c0}}
finish_test