OLD | NEW |
1 # 2013-05-23 | 1 # 2013-05-23 |
2 # | 2 # |
3 # The author disclaims copyright to this source code. In place of | 3 # The author disclaims copyright to this source code. In place of |
4 # a legal notice, here is a blessing: | 4 # a legal notice, here is a blessing: |
5 # | 5 # |
6 # May you do good and not evil. | 6 # May you do good and not evil. |
7 # May you find forgiveness for yourself and forgive others. | 7 # May you find forgiveness for yourself and forgive others. |
8 # May you share freely, never taking more than you give. | 8 # May you share freely, never taking more than you give. |
9 # | 9 # |
10 #*********************************************************************** | 10 #*********************************************************************** |
11 # | 11 # |
12 | 12 |
13 set testdir [file dirname $argv0] | 13 set testdir [file dirname $argv0] |
14 source $testdir/tester.tcl | 14 source $testdir/tester.tcl |
15 ifcapable !mmap||!vtab { | 15 ifcapable !mmap||!vtab { |
16 finish_test | 16 finish_test |
17 return | 17 return |
18 } | 18 } |
19 source $testdir/lock_common.tcl | 19 source $testdir/lock_common.tcl |
20 set testprefix mmap3 | 20 set testprefix mmap3 |
21 | 21 |
| 22 # A codec shuts down memory-mapped I/O |
| 23 if {[nonzero_reserved_bytes]} {finish_test; return;} |
| 24 |
22 do_test mmap3-1.0 { | 25 do_test mmap3-1.0 { |
23 load_static_extension db wholenumber | 26 load_static_extension db wholenumber |
24 db eval { | 27 db eval { |
25 PRAGMA mmap_size=100000; | 28 PRAGMA mmap_size=100000; |
26 CREATE TABLE t1(x, y); | 29 CREATE TABLE t1(x, y); |
27 CREATE VIRTUAL TABLE nums USING wholenumber; | 30 CREATE VIRTUAL TABLE nums USING wholenumber; |
28 INSERT INTO t1 SELECT value, randomblob(value) FROM nums | 31 INSERT INTO t1 SELECT value, randomblob(value) FROM nums |
29 WHERE value BETWEEN 1 and 1000; | 32 WHERE value BETWEEN 1 and 1000; |
30 SELECT sum(x), sum(length(y)) from t1; | 33 SELECT sum(x), sum(length(y)) from t1; |
31 PRAGMA mmap_size; | 34 PRAGMA mmap_size; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} { | 92 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} { |
90 db eval {PRAGMA mmap_size=75000} | 93 db eval {PRAGMA mmap_size=75000} |
91 } | 94 } |
92 db eval { | 95 db eval { |
93 PRAGMA quick_check; | 96 PRAGMA quick_check; |
94 PRAGMA mmap_size; | 97 PRAGMA mmap_size; |
95 } | 98 } |
96 } {ok 75000} | 99 } {ok 75000} |
97 | 100 |
98 finish_test | 101 finish_test |
OLD | NEW |