I think the thing here is...
"...But the FAIL resolution does not back out prior changes of the SQL 
statement that failed <nor does it end the transaction>..." Emphasis on the 
last part.

So you would think that in autocommit mode you would wind up in the middle of 
your "implicitly created" transaction, which you could then roll back. The 
problem appears to be that it winds up committing the data from the implicit 
transaction.

sqlite> insert into vtrig select 5;
Error: this statement seems to to temporarily disable foreign support

sqlite> select * from deptab;
id|ref
1|2

sqlite> rollback;
Error: cannot rollback - no transaction is active


-----Original Message-----
From: sqlite-users [mailto:sqlite-users-boun...@mailinglists.sqlite.org] On 
Behalf Of Richard Hipp
Sent: Friday, January 12, 2018 8:37 AM
To: SQLite mailing list
Subject: Re: [sqlite] Is foreign key support disabled within triggers with 
raise functions?

On 1/12/18, Shane Dev <devshan...@gmail.com> wrote:
> Does that mean FK constraints are only checked
> if processing reaches the end of the trigger?

FKs are checked at the end of the entire statement.  If multiple
triggers fire, then they all run to completion before any FKs are
checked.
-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to