1:
2: set testdir [file dirname $argv0]
3: source $testdir/tester.tcl
4:
5: ifcapable !vtab {
6: finish_test
7: return
8: }
9:
10: register_echo_module [sqlite3_connection_pointer db]
11:
12: do_test tkt3871-1.1 {
13: execsql {
14: BEGIN;
15: CREATE TABLE t1(a PRIMARY KEY, b UNIQUE);
16: }
17: for {set i 0} {$i < 500} {incr i} {
18: execsql { INSERT INTO t1 VALUES($i, $i*$i) }
19: }
20: execsql COMMIT
21: execsql {
22: CREATE VIRTUAL TABLE e USING echo(t1);
23: SELECT count(*) FROM e;
24: }
25: } {500}
26:
27: do_test tkt3871-1.2 {
28: execsql { SELECT * FROM e WHERE a = 1 OR a = 2 }
29: } {1 1 2 4}
30: do_test tkt3871-1.3 {
31: set echo_module ""
32: execsql { SELECT * FROM e WHERE a = 1 OR a = 2 }
33: set echo_module
34: } [list \
35: xFilter {SELECT rowid, * FROM 't1' WHERE a = ?} 1 \
36: xFilter {SELECT rowid, * FROM 't1' WHERE a = ?} 2 \
37: ]
38:
39: do_test tkt3871-1.4 {
40: execsql { SELECT * FROM e WHERE a = 1 OR a = 2 OR b = 9 }
41: } {1 1 2 4 3 9}
42: do_test tkt3871-1.5 {
43: set echo_module ""
44: execsql { SELECT * FROM e WHERE a = 1 OR a = 2 OR b = 9 }
45: set echo_module
46: } [list \
47: xFilter {SELECT rowid, * FROM 't1' WHERE a = ?} 1 \
48: xFilter {SELECT rowid, * FROM 't1' WHERE a = ?} 2 \
49: xFilter {SELECT rowid, * FROM 't1' WHERE b = ?} 9
50: ]
51:
52:
53: finish_test
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>