Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: third_party/sqlite/sqlite-src-3170000/test/mmap3.test

Issue 2747283002: [sql] Import reference version of SQLite 3.17.. (Closed)
Patch Set: Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 # 2013-05-23
2 #
3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
5 #
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.
9 #
10 #***********************************************************************
11 #
12
13 set testdir [file dirname $argv0]
14 source $testdir/tester.tcl
15 ifcapable !mmap||!vtab {
16 finish_test
17 return
18 }
19 source $testdir/lock_common.tcl
20 set testprefix mmap3
21
22 # A codec shuts down memory-mapped I/O
23 if {[nonzero_reserved_bytes]} {finish_test; return;}
24
25 do_test mmap3-1.0 {
26 load_static_extension db wholenumber
27 db eval {
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;
34 PRAGMA mmap_size;
35 }
36 } {100000 500500 500500 100000}
37 do_test mmap3-1.2 {
38 db eval {
39 PRAGMA mmap_size=50000;
40 CREATE TABLE t2(a,b);
41 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
42 PRAGMA quick_check;
43 PRAGMA mmap_size;
44 }
45 } {50000 nums t1 t2 ok 50000}
46 do_test mmap3-1.3 {
47 db eval {
48 PRAGMA mmap_size=250000;
49 DROP TABLE t2;
50 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
51 PRAGMA quick_check;
52 PRAGMA mmap_size;
53 }
54 } {250000 nums t1 ok 250000}
55 do_test mmap3-1.4 {
56 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
57 db eval {PRAGMA mmap_size=150000}
58 }
59 db eval {
60 PRAGMA quick_check;
61 PRAGMA mmap_size;
62 }
63 } {ok 250000}
64 do_test mmap3-1.5 {
65 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
66 db eval {PRAGMA mmap_size=0}
67 }
68 db eval {
69 PRAGMA quick_check;
70 PRAGMA mmap_size;
71 }
72 } {ok 250000}
73 do_test mmap3-1.6 {
74 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
75 set x [db one {PRAGMA mmap_size}]
76 }
77 set x [concat $x [db eval {
78 PRAGMA quick_check;
79 PRAGMA mmap_size;
80 }]]
81 } {250000 ok 250000}
82 do_test mmap3-1.7 {
83 db eval {
84 PRAGMA mmap_size(0);
85 CREATE TABLE t3(a,b,c);
86 SELECT name FROM sqlite_master WHERE type='table' ORDER BY 1;
87 PRAGMA quick_check;
88 PRAGMA mmap_size;
89 }
90 } {0 nums t1 t3 ok 0}
91 do_test mmap3-1.8 {
92 db eval {SELECT x FROM t1 WHERE +x BETWEEN 10 AND 15} {
93 db eval {PRAGMA mmap_size=75000}
94 }
95 db eval {
96 PRAGMA quick_check;
97 PRAGMA mmap_size;
98 }
99 } {ok 75000}
100
101 finish_test
OLDNEW
« no previous file with comments | « third_party/sqlite/sqlite-src-3170000/test/mmap2.test ('k') | third_party/sqlite/sqlite-src-3170000/test/mmap4.test » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698