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 source [file join [file dirname [info script]] rbu_common.tcl]
14 if_no_rbu_support { finish_test ; return }
15 source $testdir/malloc_common.tcl
16 set ::testprefix rbufault4
18 for {set tn 1} {1} {incr tn} {
21 CREATE TABLE t1(a INTEGER PRIMARY KEY, b, c);
22 CREATE INDEX i1b ON t1(b);
23 CREATE INDEX i1c ON t1(c);
24 INSERT INTO t1 VALUES(1, 2, 3);
25 INSERT INTO t1 VALUES(4, 5, 6);
30 sqlite3rbu_vacuum rbu test.db test.db2
31 for {set i 0} {$i < $tn} {incr i} { rbu step }
33 if {$rc!="SQLITE_OK"} {
34 if {$rc!="SQLITE_DONE"} {error $rc}
39 do_faultsim_test $tn -faults oom-t* -prep {
42 sqlite3rbu_vacuum rbu test.db test.db2
45 if {$rc=="SQLITE_DONE"} break
46 if {$rc!="SQLITE_OK"} { error $rc }
50 faultsim_test_result {0 {}} {1 SQLITE_NOMEM} {1 SQLITE_IOERR_NOMEM}
52 sqlite3rbu_vacuum rbu test.db test.db2
53 while {[rbu step]=="SQLITE_OK"} {}
55 if {$trc!="SQLITE_DONE"} { error "Got $trc instead of SQLITE_DONE!" }
58 set rc [db one {PRAGMA integrity_check}]
59 if {$rc!="ok"} { error "Got $rc instead of ok!" }