diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:28:19 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-05 17:28:19 +0000 |
commit | 18657a960e125336f704ea058e25c27bd3900dcb (patch) | |
tree | 17b438b680ed45a996d7b59951e6aa34023783f2 /test/tkt3871.test | |
parent | Initial commit. (diff) | |
download | sqlite3-18657a960e125336f704ea058e25c27bd3900dcb.tar.xz sqlite3-18657a960e125336f704ea058e25c27bd3900dcb.zip |
Adding upstream version 3.40.1.upstream/3.40.1upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | test/tkt3871.test | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/test/tkt3871.test b/test/tkt3871.test new file mode 100644 index 0000000..d587910 --- /dev/null +++ b/test/tkt3871.test @@ -0,0 +1,53 @@ + +set testdir [file dirname $argv0] +source $testdir/tester.tcl + +ifcapable !vtab { + finish_test + return +} + +register_echo_module [sqlite3_connection_pointer db] + +do_test tkt3871-1.1 { + execsql { + BEGIN; + CREATE TABLE t1(a PRIMARY KEY, b UNIQUE); + } + for {set i 0} {$i < 500} {incr i} { + execsql { INSERT INTO t1 VALUES($i, $i*$i) } + } + execsql COMMIT + execsql { + CREATE VIRTUAL TABLE e USING echo(t1); + SELECT count(*) FROM e; + } +} {500} + +do_test tkt3871-1.2 { + execsql { SELECT * FROM e WHERE a = 1 OR a = 2 } +} {1 1 2 4} +do_test tkt3871-1.3 { + set echo_module "" + execsql { SELECT * FROM e WHERE a = 1 OR a = 2 } + set echo_module +} [list \ + xFilter {SELECT rowid, a, b FROM 't1' WHERE a = ?} 1 \ + xFilter {SELECT rowid, a, b FROM 't1' WHERE a = ?} 2 \ +] + +do_test tkt3871-1.4 { + execsql { SELECT * FROM e WHERE a = 1 OR a = 2 OR b = 9 } +} {1 1 2 4 3 9} +do_test tkt3871-1.5 { + set echo_module "" + execsql { SELECT * FROM e WHERE a = 1 OR a = 2 OR b = 9 } + set echo_module +} [list \ + xFilter {SELECT rowid, a, b FROM 't1' WHERE a = ?} 1 \ + xFilter {SELECT rowid, a, b FROM 't1' WHERE a = ?} 2 \ + xFilter {SELECT rowid, a, b FROM 't1' WHERE b = ?} 9 +] + + +finish_test |