Re: [sqlite] ROLLBACK TO stmt within committed transaction cause write operation to the WAL file.

2018-12-28 Thread Clemens Ladisch
sanhua.zh wrote: >BEGIN IMMEDIATE; >SAVEPOINT s1; >INSERT INTO t VALUES(2); >ROLLBACK TO SAVEPOINT s1; >COMMIT; >SOMETHING appended into the end of WAL file. >BUT why? We should have nothing to write. It's information about the WAL file itself. The WAL file must be initialized at some time, so i

[sqlite] ROLLBACK TO stmt within committed transaction cause write operation to the WAL file.

2018-12-27 Thread sanhua.zh
Here is the reproduction path. ``` sqlite3 db PRAGMA journal_mode=WAL; CREATE TABLE t(i INTEGER); INSERT INTO t VALUES(1); PRAGMA wal_checkpoint=TRUNCATE; // check the WAL file size without checkpoint/close sqlite connection ls -l | grep wal // print 0 db-wal BEGIN IMMEDIATE; SAVEPOINT s1; IN