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/malloc_common.tcl
16 set testprefix statfault
18 ifcapable !vtab||!compound {
23 register_dbstat_vtab db
24 do_execsql_test statfault-1 {
25 CREATE TABLE t1(a, b UNIQUE);
26 INSERT INTO t1 VALUES(1, randomblob(500));
27 INSERT INTO t1 VALUES(randomblob(500), 1);
28 INSERT INTO t1 VALUES(2, randomblob(250));
29 INSERT INTO t1 VALUES(randomblob(250), 2);
30 CREATE VIRTUAL TABLE sss USING dbstat;
32 faultsim_save_and_close
34 do_faultsim_test 1 -faults * -prep {
35 faultsim_restore_and_reopen
36 register_dbstat_vtab db
37 execsql { SELECT 1 FROM sqlite_master LIMIT 1 }
39 execsql { SELECT count(*) FROM sss }
41 faultsim_test_result {0 8}
44 do_faultsim_test 2 -faults * -prep {
45 faultsim_restore_and_reopen
46 register_dbstat_vtab db
47 execsql { SELECT 1 FROM sqlite_master LIMIT 1 }
49 db eval { SELECT * FROM sss } { db eval { SELECT randomblob(5000) } }
51 faultsim_test_result {0 {}}