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
15 ifcapable !mmap||!vtab {
19 source $testdir/lock_common.tcl
22 # A codec shuts down memory-mapped I/O
23 if {[nonzero_reserved_bytes]} {finish_test; return;}
26 load_static_extension db wholenumber
28 PRAGMA mmap_size=100000;
29 CREATE TABLE t1(x, y);
30 CREATE VIRTUAL TABLE nums USING wholenumber;
31 INSERT INTO t1 SELECT value, randomblob(value) FROM nums
32 WHERE value BETWEEN 1 and 1000;
33 SELECT sum(x), sum(length(y)) from t1;
36 } {100000 500500 500500 100000}
39 PRAGMA mmap_size=50000;
41 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
45 } {50000 nums t1 t2 ok 50000}
48 PRAGMA mmap_size=250000;
50 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
54 } {250000 nums t1 ok 250000}
56 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
57 db eval {PRAGMA mmap_size=150000}
65 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
66 db eval {PRAGMA mmap_size=0}
74 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
75 set x [db one {PRAGMA mmap_size}]
77 set x [concat $x [db eval {
85 CREATE TABLE t3(a,b,c);
86 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
92 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
93 db eval {PRAGMA mmap_size=75000}