3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
6 # May you do good and not evil.
7 # May you find forgiveness for yourself and forgive others.
8 # May you share freely, never taking more than you give.
10 #***********************************************************************
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 source $testdir/lock_common.tcl
16 source $testdir/malloc_common.tcl
18 if {[permutation] == "inmemory_journal"} {
23 # Create a database with page-size 2048 bytes that uses 2 pages. Populate
24 # it so that if the page-size is changed to 1024 bytes and the db vacuumed,
25 # the new db size is 3 pages.
27 do_test pagerfault3-pre1 {
29 PRAGMA auto_vacuum = 0;
30 PRAGMA page_size = 2048;
32 INSERT INTO t1 VALUES(randomblob(1200));
36 do_test pagerfault3-pre2 {
37 faultsim_save_and_close
38 faultsim_restore_and_reopen
40 PRAGMA page_size = 1024;
46 # Now do the page-size change and VACUUM with IO error injection. When
47 # an IO error is injected into the final xSync() of the commit, the pager
48 # will have to extend the db file from 3072 to 4096 byts when rolling
49 # back the hot-journal file. This is a special case in pager_truncate().
51 do_faultsim_test pagerfault3-1 -faults ioerr-transient -prep {
52 faultsim_restore_and_reopen
55 PRAGMA page_size = 1024;
59 faultsim_test_result {0 {}}
60 faultsim_integrity_check