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 #***********************************************************************
12 # This file contains tests for using WAL databases in read-only mode.
15 set testdir [file dirname $argv0]
16 source $testdir/tester.tcl
17 source $testdir/malloc_common.tcl
18 set ::testprefix walro2
20 # And only if the build is WAL-capable.
34 PRAGMA journal_mode = wal;
35 INSERT INTO t1 VALUES('hello');
36 INSERT INTO t1 VALUES('world');
37 INSERT INTO t1 VALUES('!');
38 INSERT INTO t1 VALUES('world');
39 INSERT INTO t1 VALUES('hello');
40 PRAGMA cache_size = 10;
42 WITH s(i) AS ( SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<30 )
43 INSERT INTO t1(b) SELECT randomblob(800) FROM s;
45 file_control_persist_wal db 1; db close
46 faultsim_save_and_close
48 do_faultsim_test 1 -faults oom* -prep {
51 sqlite3 db file:test.db?readonly_shm=1
53 execsql { SELECT * FROM t1 }
55 faultsim_test_result {0 {hello world ! world hello}}