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
23 load_static_extension db wholenumber
25 PRAGMA mmap_size=100000;
26 CREATE TABLE t1(x, y);
27 CREATE VIRTUAL TABLE nums USING wholenumber;
28 INSERT INTO t1 SELECT value, randomblob(value) FROM nums
29 WHERE value BETWEEN 1 and 1000;
30 SELECT sum(x), sum(length(y)) from t1;
33 } {100000 500500 500500 100000}
36 PRAGMA mmap_size=50000;
38 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
42 } {50000 nums t1 t2 ok 50000}
45 PRAGMA mmap_size=250000;
47 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
51 } {250000 nums t1 ok 250000}
53 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
54 db eval {PRAGMA mmap_size=150000}
62 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
63 db eval {PRAGMA mmap_size=0}
71 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
72 set x [db one {PRAGMA mmap_size}]
74 set x [concat $x [db eval {
82 CREATE TABLE t3(a,b,c);
83 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
89 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
90 db eval {PRAGMA mmap_size=75000}