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
20 proc msg {args} { puts $args }
25 set testprefix mmapwarm
29 PRAGMA auto_vacuum = 0;
30 CREATE TABLE t1(x, y);
32 SELECT 1 UNION ALL SELECT i+1 FROM s WHERE i<500
34 INSERT INTO t1 SELECT randomblob(400), randomblob(500) FROM s;
41 db eval {PRAGMA mmap_size = 1000000}
48 db eval {PRAGMA mmap_size = 1000000}
49 sqlite3_mmap_warm db "main"
60 sqlite3_mmap_warm db "main"
67 sqlite3_mmap_warm db "main"
70 do_faultsim_test 3 -faults oom* -prep {
72 sqlite3_db_config_lookaside db 0 0 0
73 db eval { PRAGMA mmap_size = 1000000 }
74 db eval { SELECT * FROM sqlite_master }
76 sqlite3_mmap_warm db "main"
78 faultsim_test_result {0 SQLITE_OK} {0 SQLITE_NOMEM}