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 #***********************************************************************
11 # This file implements regression tests for SQLite library. Specifically,
12 # it tests that ticket [2d1a5c67dfc2363e44f29d9bbd57f7331851390a] has
18 set testdir [file dirname $argv0]
19 source $testdir/tester.tcl
21 ifcapable !wal {finish_test; return}
23 for {set ii 1} {$ii<=10} {incr ii} {
24 do_test tkt-2d1a5c67d.1.$ii {
26 forcedelete test.db test.db-wal
28 db eval "PRAGMA cache_size=$::ii"
30 PRAGMA journal_mode=WAL;
32 CREATE INDEX t1b ON t1(b);
33 CREATE TABLE t2(x,y UNIQUE);
34 INSERT INTO t2 VALUES(3,4);
36 INSERT INTO t1(a,b) VALUES(1,2);
37 SELECT 'A', * FROM t2 WHERE y=4;
38 SELECT 'B', * FROM t1;
40 SELECT 'C', * FROM t1;
42 } {wal A 3 4 B 1 2 C 1 2}
46 forcedelete test.db test.db-wal
48 register_wholenumber_module db
50 PRAGMA journal_mode=WAL;
52 CREATE INDEX t1b ON t1(b);
54 CREATE VIRTUAL TABLE nums USING wholenumber;
55 INSERT INTO t2 SELECT value, randomblob(1000) FROM nums
56 WHERE value BETWEEN 1 AND 1000;
59 for {set ii 1} {$ii<=10} {incr ii} {
60 do_test tkt-2d1a5c67d.2.$ii {
61 db eval "PRAGMA cache_size=$::ii"
65 INSERT INTO t1(a,b) VALUES(1,2);
66 SELECT sum(length(y)) FROM t2;