# 2010 May 03 # # The author disclaims copyright to this source code. In place of # a legal notice, here is a blessing: # # May you do good and not evil. # May you find forgiveness for yourself and forgive others. # May you share freely, never taking more than you give. # #*********************************************************************** # This file implements regression tests for SQLite library. The # focus of this file is testing the operation of the library in # "PRAGMA journal_mode=WAL" mode. # set testdir [file dirname $argv0] source $testdir/tester.tcl source $testdir/malloc_common.tcl ifcapable !wal {finish_test ; return } do_malloc_test walfault-oom-1 -sqlbody { PRAGMA journal_mode = WAL; CREATE TABLE t1(a, b); INSERT INTO t1 VALUES(1, 2); PRAGMA wal_checkpoint; } do_malloc_test walfault-oom-2 -tclprep { execsql { PRAGMA journal_mode = WAL; BEGIN; CREATE TABLE x(y, z, UNIQUE(y, z)); INSERT INTO x VALUES(randomblob(100), randomblob(100)); COMMIT; PRAGMA wal_checkpoint; INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x; INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x; INSERT INTO x SELECT randomblob(100), randomblob(100) FROM x; } file copy -force test.db testX.db file copy -force test.db-wal testX.db-wal db close file rename -force testX.db test.db file rename -force testX.db-wal test.db-wal sqlite3 db test.db sqlite3_extended_result_codes db 1 sqlite3_db_config_lookaside db 0 0 0 } -sqlbody { SELECT count(*) FROM x; } finish_test