1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Add a version number to the wal-index header. If SQLite encounters a version number in either the wal or wal-index files that it does not understand, the operation is abandoned and SQLITE_CANTOPEN returned.

FossilOrigin-Name: 8d0f8a7f70d6fb42369411a934b30f8c8ca8322f
This commit is contained in:
dan
2010-06-23 15:55:43 +00:00
parent b316cb22de
commit 10f5a50e57
13 changed files with 324 additions and 152 deletions

View File

@ -15,12 +15,12 @@
set testdir [file dirname $argv0]
source $testdir/tester.tcl
source $testdir/wal_common.tcl
do_not_use_codec
ifcapable !wal {finish_test ; return }
proc log_file_size {nFrame pgsz} {
expr {24 + ($pgsz+24)*$nFrame}
}
# Test organization:
#
@ -69,11 +69,11 @@ do_test walbak-1.4 {
} {wal}
do_test walbak-1.5 {
list [file size test.db] [file size test.db-wal]
} [list 1024 [log_file_size 6 1024]]
} [list 1024 [wal_file_size 6 1024]]
do_test walbak-1.6 {
execsql { PRAGMA wal_checkpoint }
list [file size test.db] [file size test.db-wal]
} [list [expr 3*1024] [log_file_size 6 1024]]
} [list [expr 3*1024] [wal_file_size 6 1024]]
do_test walbak-1.7 {
execsql {
CREATE TABLE t2(a, b);
@ -81,15 +81,15 @@ do_test walbak-1.7 {
DROP TABLE t1;
}
list [file size test.db] [file size test.db-wal]
} [list [expr 3*1024] [log_file_size 6 1024]]
} [list [expr 3*1024] [wal_file_size 6 1024]]
do_test walbak-1.8 {
execsql { VACUUM }
list [file size test.db] [file size test.db-wal]
} [list [expr 3*1024] [log_file_size 8 1024]]
} [list [expr 3*1024] [wal_file_size 8 1024]]
do_test walbak-1.9 {
execsql { PRAGMA wal_checkpoint }
list [file size test.db] [file size test.db-wal]
} [list [expr 2*1024] [log_file_size 8 1024]]
} [list [expr 2*1024] [wal_file_size 8 1024]]
#-------------------------------------------------------------------------
# Backups when the source db is modified mid-backup.