Re: [sqlite] Surprising result from changes() after constraint violation

2017-07-22 Thread Simon Slavin
On 21 Jul 2017, at 10:50pm, Steven Friedman wrote: > sqlite> insert into t2 (c1) values (1); > Error: foreign key mismatch - "t2" referencing "t1" > sqlite> select changes(); "changes()" is returning the value of the last /successfull/ command which makes

[sqlite] Surprising result from changes() after constraint violation

2017-07-22 Thread Steven Friedman
Running Sqlite 3.19.3, an insert failed because of a constraint violation and the return value from changes() was not what I would have expected. Why did "select changes()" return "3" on the second call, even though nothing was inserted into the db? sqlite> pragma foreign_keys=1; sqlite>