mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-01 06:27:03 +03:00
Fix a problem with rolling back to a savepoint opened before the writer decided to wrap the log file.
FossilOrigin-Name: 6b4aed6aae7dc9e92807d27375cbe1e83c15841b
This commit is contained in:
@ -1460,5 +1460,36 @@ integrity_check wal-20.5
|
||||
|
||||
catch { db2 close }
|
||||
catch { db close }
|
||||
file delete -force test.db test.db-wal test.db-journal
|
||||
|
||||
do_test wal-21.1 {
|
||||
sqlite3 db test.db
|
||||
execsql {
|
||||
PRAGMA journal_mode = WAL;
|
||||
CREATE TABLE t1(a, b);
|
||||
INSERT INTO t1 VALUES(1, 2);
|
||||
INSERT INTO t1 VALUES(3, 4);
|
||||
INSERT INTO t1 VALUES(5, 6);
|
||||
INSERT INTO t1 VALUES(7, 8);
|
||||
INSERT INTO t1 VALUES(9, 10);
|
||||
INSERT INTO t1 VALUES(11, 12);
|
||||
}
|
||||
} {wal}
|
||||
do_test wal-21.2 {
|
||||
execsql {
|
||||
PRAGMA cache_size = 10;
|
||||
PRAGMA wal_checkpoint;
|
||||
BEGIN;
|
||||
SAVEPOINT s;
|
||||
INSERT INTO t1 SELECT randomblob(900), randomblob(900) FROM t1;
|
||||
ROLLBACK TO s;
|
||||
COMMIT;
|
||||
SELECT * FROM t1;
|
||||
}
|
||||
} {1 2 3 4 5 6 7 8 9 10 11 12}
|
||||
do_test wal-21.3 {
|
||||
execsql { PRAGMA integrity_check }
|
||||
} {ok}
|
||||
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user