Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Richard Hipp
On 5/7/19, Manuel Rigger wrote: > Great, thanks! In which commits were they addressed? I saw two commits that > address https://www.sqlite.org/src/info/e63cbcfd3378afe6980d6. Was this > issue derived from the test case? Issue 1: Foreign key constraints are not checked until the end of a

Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Manuel Rigger
Great, thanks! In which commits were they addressed? I saw two commits that address https://www.sqlite.org/src/info/e63cbcfd3378afe6980d6. Was this issue derived from the test case? Best, Manuel On Tue, May 7, 2019 at 10:08 PM Richard Hipp wrote: > Two separate problems, both now fixed on

Re: [sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-07 Thread Richard Hipp
Two separate problems, both now fixed on trunk. On 5/6/19, Manuel Rigger wrote: > Hi everyone, > > consider the following example: > > PRAGMA foreign_keys=true; > CREATE TABLE t0 (c0 UNIQUE, c1 UNIQUE, FOREIGN KEY(c0) REFERENCES t0(c1)); > INSERT OR FAIL INTO t0(c0, c1) VALUES > (0, 1), > (0,

[sqlite] INSERT OR FAIL inserts row although it violates a table constraint

2019-05-06 Thread Manuel Rigger
Hi everyone, consider the following example: PRAGMA foreign_keys=true; CREATE TABLE t0 (c0 UNIQUE, c1 UNIQUE, FOREIGN KEY(c0) REFERENCES t0(c1)); INSERT OR FAIL INTO t0(c0, c1) VALUES (0, 1), (0, 2); SELECT * FROM t0; -- returns 0|1 I expect the INSERT to fail, since both the UNIQUE and the