blob: 8ff8e4b77c4d8a8467c05d56e7a0e9e05846c50c [file] [log] [blame]
danbc760632014-03-20 09:42:09 +00001# 2010 April 13
2#
3# The author disclaims copyright to this source code. In place of
4# a legal notice, here is a blessing:
5#
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.
9#
10#***********************************************************************
11# This file implements regression tests for SQLite library. The
12# focus of this file is testing the operation of the library in
13# "PRAGMA journal_mode=WAL" mode.
14#
15
16set testdir [file dirname $argv0]
17source $testdir/tester.tcl
18set testprefix wal64k
19
20ifcapable !wal {finish_test ; return }
21
drh70c93202014-03-28 14:41:35 +000022if {$tcl_platform(platform) != "unix"} {
23 finish_test
24 return
25}
26
danbc760632014-03-20 09:42:09 +000027db close
28test_syscall pagesize 65536
29sqlite3 db test.db
30
31do_execsql_test 1.0 {
32 PRAGMA journal_mode = WAL;
33 CREATE TABLE t1(x);
34 CREATE INDEX i1 ON t1(x);
35} {wal}
36do_test 1.1 { file size test.db-shm } {65536}
37
38do_test 1.2 {
39 execsql BEGIN
40 while {[file size test.db-shm]==65536} {
41 execsql { INSERT INTO t1 VALUES( randstr(900,1100) ) }
42 }
43 execsql COMMIT
44 file size test.db-shm
45} {131072}
46
47integrity_check 1.3
48
49db close
drhb6c4d592018-10-11 02:39:11 +000050forcedelete test.db
51sqlite3 db test.db -vfs unix-excl
52do_execsql_test 2.1 {
53 PRAGMA page_size=512;
54 PRAGMA journal_mode=WAL;
55 CREATE TABLE t1(a,b);
56 WITH RECURSIVE c(x) AS (VALUES(1) UNION ALL SELECT x+1 FROM c WHERE x<8200)
57 INSERT INTO t1(a,b) SELECT x, zeroblob(300) FROM c;
58 PRAGMA integrity_check;
59} {wal ok}
60
61db close
danbc760632014-03-20 09:42:09 +000062test_syscall pagesize -1
63finish_test