On Wed, Oct 29, 2014 at 6:35 AM, d...@gmx.com <d...@gmx.com> wrote:

> Hello!
>
> I have met the situation, which looks like sqlit3 bug. The full script
> can be found at [1]. To reproduce it, I just type:
>
> sqlite3 -batch /tmp/db-2.tmp < /tmp/x.sql
>
> Where /tmp/x.sql is the saved to disk script [1].
>
> So, the essential problem lies in the last lines:
>
> PRAGMA foreign_keys=ON;
> PRAGMA journal_mode = DELETE;
> BEGIN;
> INSERT INTO "order_item_file" ( "context", "file_id", "order_item_id")
> VALUES ( 'page_2', 4, 1 );
> ROLLBACK;
> SELECT * FROM "order_item_file";
>
> I expected, that it should delete the inserted row after rollback, but
> it doesn't . What is the reason for that?
>

The row exists before the start of the transaction, which you can see if
you insert another SELECT before the BEGIN.


-- 
D. Richard Hipp
d...@sqlite.org
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to