| 1 |
# 2019-12-05 |
| 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 |
# Additional test cases |
| 12 |
|
| 13 |
if {![info exists testdir]} { |
| 14 |
set testdir [file join [file dirname [info script]] .. .. test] |
| 15 |
} |
| 16 |
source [file join [file dirname [info script]] rtree_util.tcl] |
| 17 |
source $testdir/tester.tcl |
| 18 |
ifcapable !rtree { finish_test ; return } |
| 19 |
|
| 20 |
# The following is a test of rowvalue handling on virtual tables that |
| 21 |
# deal with inequalities and that set the OMIT flag on terms of the |
| 22 |
# WHERE clause. This is not specific to rtree. We just use rtree because |
| 23 |
# it is a convenient test platform since it has all the right |
| 24 |
# characteristics. |
| 25 |
# |
| 26 |
do_execsql_test rtreeI-1.10 { |
| 27 |
CREATE TABLE t1(a); |
| 28 |
INSERT INTO t1 VALUES(2); |
| 29 |
CREATE VIRTUAL TABLE t2 USING rtree(id,x0,x1); |
| 30 |
INSERT INTO t2(id,x0,x1) VALUES(1,2,3); |
| 31 |
} {} |
| 32 |
do_execsql_test rtreeI-1.20 { |
| 33 |
SELECT 123 FROM t1, t2 WHERE (a,0)>(x0,0); |
| 34 |
} {} |
| 35 |
do_execsql_test rtreeI-1.21 { |
| 36 |
SELECT 123 FROM t1, t2 WHERE (a,0.1)>(x0,0); |
| 37 |
} {123} |
| 38 |
do_execsql_test rtreeI-1.22 { |
| 39 |
SELECT 123 FROM t1, t2 WHERE (a,0)>=(x0,0); |
| 40 |
} {123} |
| 41 |
do_execsql_test rtreeI-1.23 { |
| 42 |
SELECT 123 FROM t1, t2 WHERE (a,0)<=(x0,0); |
| 43 |
} {123} |
| 44 |
do_execsql_test rtreeI-1.24 { |
| 45 |
SELECT 123 FROM t1, t2 WHERE (a,0)<(x0,0); |
| 46 |
} {} |
| 47 |
do_execsql_test rtreeI-1.30 { |
| 48 |
SELECT 123 FROM t1, t2 WHERE (x0,0)<(a,0); |
| 49 |
} {} |
| 50 |
do_execsql_test rtreeI-1.31 { |
| 51 |
SELECT 123 FROM t1, t2 WHERE (x0,0)<(a,0.1); |
| 52 |
} {123} |
| 53 |
do_execsql_test rtreeI-1.40 { |
| 54 |
SELECT 123 FROM t1, t2 WHERE x1<5 AND id<99 AND (a,0)>(x0,0); |
| 55 |
} {} |
| 56 |
do_execsql_test rtreeI-1.41 { |
| 57 |
SELECT 123 FROM t1, t2 WHERE x1<5 AND id<99 AND (a,0.5)>(x0,0); |
| 58 |
} {123} |
| 59 |
do_execsql_test rtreeI-1.42 { |
| 60 |
SELECT 123 FROM t1, t2 WHERE x1<5 AND id<99 AND (a,0)>=(x0,0); |
| 61 |
} {123} |
| 62 |
do_execsql_test rtreeI-1.43 { |
| 63 |
SELECT 123 FROM t1, t2 WHERE x1<5 AND id<99 AND (a,0)<(x0,0); |
| 64 |
} {} |
| 65 |
do_execsql_test rtreeI-1.50 { |
| 66 |
SELECT 123 FROM t1, t2 WHERE 5>x1 AND 99>id AND (x0,0)<(a,0); |
| 67 |
} {} |
| 68 |
do_execsql_test rtreeI-1.51 { |
| 69 |
SELECT 123 FROM t1, t2 WHERE 5>x1 AND 99>id AND (x0,0)<(a,0.5); |
| 70 |
} {123} |
| 71 |
|
| 72 |
|
| 73 |
|
| 74 |
finish_test |