mirror of
https://github.com/sqlite/sqlite.git
synced 2025-07-29 08:01:23 +03:00
Increase the max_page_count on ROLLBACK, if necessary, so that it is sufficient
to cover the entire database. Fix for the problem identified by [forum:/forumpost/3b9e894312|forum post 3b9e894312]. FossilOrigin-Name: 12c012162ce110a7a7fbbe853f422e23cb4ae10b45237727328c8f3315b70842
This commit is contained in:
@ -2925,4 +2925,32 @@ do_test 43.3 {
|
||||
sqlite3_db_status db CACHE_MISS 0
|
||||
} {0 1 0}
|
||||
|
||||
# 2022-03-01 Forum post https://sqlite.org/forum/forumpost/3b9e894312
|
||||
# Ensure that max_page_count gets adjusted upward, if needed, on a
|
||||
# ROLLBACK.
|
||||
#
|
||||
db close
|
||||
sqlite3 db :memory:
|
||||
do_execsql_test 44.1 {
|
||||
PRAGMA page_size=4096;
|
||||
PRAGMA auto_vacuum=FULL;
|
||||
CREATE TABLE t1(a INTEGER PRIMARY KEY, b ANY);
|
||||
WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<50)
|
||||
INSERT INTO t1(a,b) SELECT x, zeroblob(1000) FROM c;
|
||||
CREATE TABLE t2 AS SELECT * FROM t1;
|
||||
PRAGMA page_count;
|
||||
} {31}
|
||||
do_execsql_test 44.2 {
|
||||
BEGIN;
|
||||
DROP TABLE t2;
|
||||
PRAGMA incremental_vacuum=50;
|
||||
PRAGMA page_count;
|
||||
PRAGMA max_page_count=2;
|
||||
} {16 16}
|
||||
do_execsql_test 44.3 {
|
||||
ROLLBACK;
|
||||
PRAGMA page_count;
|
||||
PRAGMA max_page_count;
|
||||
} {31 31}
|
||||
|
||||
finish_test
|
||||
|
Reference in New Issue
Block a user