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

Side by Side Diff: third_party/sqlite/ext/rtree/rtree6.test

Issue 3108030: Move bundled copy of sqlite one level deeper to better separate it... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « third_party/sqlite/ext/rtree/rtree5.test ('k') | third_party/sqlite/ext/rtree/rtree_perf.tcl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 # 2008 Sep 1
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 # $Id: rtree6.test,v 1.1 2008/09/01 12:47:00 danielk1977 Exp $
13 #
14
15 if {![info exists testdir]} {
16 set testdir [file join [file dirname $argv0] .. .. test]
17 }
18 source $testdir/tester.tcl
19
20 ifcapable !rtree {
21 finish_test
22 return
23 }
24
25 # Operator Byte Value
26 # ----------------------
27 # = 0x41 ('A')
28 # <= 0x42 ('B')
29 # < 0x43 ('C')
30 # >= 0x44 ('D')
31 # > 0x45 ('E')
32 # ----------------------
33
34 proc rtree_strategy {sql} {
35 set ret [list]
36 db eval "explain $sql" a {
37 if {$a(opcode) eq "VFilter"} {
38 lappend ret $a(p4)
39 }
40 }
41 set ret
42 }
43
44 proc query_plan {sql} {
45 set ret [list]
46 db eval "explain query plan $sql" a {
47 lappend ret $a(detail)
48 }
49 set ret
50 }
51
52 do_test rtree6-1.1 {
53 execsql {
54 CREATE TABLE t2(k INTEGER PRIMARY KEY, v);
55 CREATE VIRTUAL TABLE t1 USING rtree(ii, x1, x2, y1, y2);
56 }
57 } {}
58
59 do_test rtree6-1.2 {
60 rtree_strategy {SELECT * FROM t1 WHERE x1>10}
61 } {Ea}
62
63 do_test rtree6-1.3 {
64 rtree_strategy {SELECT * FROM t1 WHERE x1<10}
65 } {Ca}
66
67 do_test rtree6-1.4 {
68 rtree_strategy {SELECT * FROM t1,t2 WHERE k=ii AND x1<10}
69 } {Ca}
70
71 do_test rtree6-1.5 {
72 rtree_strategy {SELECT * FROM t1,t2 WHERE k=+ii AND x1<10}
73 } {Ca}
74
75 do_test rtree6.2.1 {
76 query_plan {SELECT * FROM t1,t2 WHERE k=+ii AND x1<10}
77 } [list \
78 {TABLE t1 VIRTUAL TABLE INDEX 2:Ca} \
79 {TABLE t2 USING PRIMARY KEY} \
80 ]
81
82 do_test rtree6.2.2 {
83 query_plan {SELECT * FROM t1,t2 WHERE k=ii AND x1<10}
84 } [list \
85 {TABLE t1 VIRTUAL TABLE INDEX 2:Ca} \
86 {TABLE t2 USING PRIMARY KEY} \
87 ]
88
89 do_test rtree6.2.3 {
90 query_plan {SELECT * FROM t1,t2 WHERE k=ii}
91 } [list \
92 {TABLE t2} \
93 {TABLE t1 VIRTUAL TABLE INDEX 1:} \
94 ]
95
96 do_test rtree6.2.4 {
97 query_plan {SELECT * FROM t1,t2 WHERE v=10 and x1<10 and x2>10}
98 } [list \
99 {TABLE t1 VIRTUAL TABLE INDEX 2:CaEb} \
100 {TABLE t2} \
101 ]
102
103 do_test rtree6.2.5 {
104 query_plan {SELECT * FROM t1,t2 WHERE k=ii AND x1<v}
105 } [list \
106 {TABLE t2} \
107 {TABLE t1 VIRTUAL TABLE INDEX 1:} \
108 ]
109
110 finish_test
111
OLDNEW
« no previous file with comments | « third_party/sqlite/ext/rtree/rtree5.test ('k') | third_party/sqlite/ext/rtree/rtree_perf.tcl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698