Works here;

SQLite version 3.13.0 2016-05-18 10:57:30
Enter ".help" for usage hints.
Connected to a transient in-memory database.
Use ".open FILENAME" to reopen on a persistent database.
sqlite> CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT);
sqlite> INSERT INTO foo (bar) VALUES(1234);
sqlite> SELECT * FROM foo;
1234
sqlite> UPDATE foo SET bar=5678;
sqlite> SELECT * FROM foo;
5678
sqlite> DELETE FROM foo;
sqlite> SELECT * FROM foo;
sqlite> INSERT INTO foo DEFAULT VALUES;
sqlite> SELECT * FROM foo;

And in one transaction;
sqlite> begin;
sqlite> CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT);
sqlite> INSERT INTO foo (bar) VALUES(1234);
sqlite> SELECT * FROM foo;
1234
sqlite> UPDATE foo SET bar=5678;
sqlite> SELECT * FROM foo;
5678
sqlite> DELETE FROM foo;
sqlite> SELECT * FROM foo;
sqlite> INSERT INTO foo DEFAULT VALUES;
sqlite> SELECT * FROM foo;
1235
sqlite> commit;


On Fri, Oct 28, 2016 at 2:46 AM, Radovan Antloga <radovan.antl...@siol.net>
wrote:

> After line:
> UPDATE foo SET bar=5678;
>
> put this sql command:
> COMMIT;
>
> If you execute all statements in one sql
> (except last), they are executed in one transaction.
>
> Regards
> Radovan
>
>
> Adam Goldman je 27.10.2016 ob 11:52 napisal:
>
> Hi,
>>
>> I expected the test case below to print 5679, but it prints 1235
>> instead. I tested under a few versions including 3.15.0. It's a bit of a
>> corner case and I worked around it in my application, but I guess it's a
>> bug.
>>
>> CREATE TABLE foo (bar INTEGER PRIMARY KEY AUTOINCREMENT);
>> INSERT INTO foo (bar) VALUES(1234);
>> UPDATE foo SET bar=5678;
>> DELETE FROM foo;
>> INSERT INTO foo DEFAULT VALUES;
>> SELECT * FROM foo;
>>
>> -- Adam
>> _______________________________________________
>> 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
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to