Add test cases to prove that ticket #3082 has been fixed. (CVS 5048)

FossilOrigin-Name: 776e7024101dd2eeb29484a36c7e1ac751444ec8
This commit is contained in:
drh
2008-04-25 12:10:15 +00:00
parent b287f4b646
commit 05a3e474cb
3 changed files with 49 additions and 8 deletions
+42 -1
View File
@@ -12,9 +12,13 @@
# focus of this file is is verifying that a virtual table in the
# TEMP database that is created and dropped within a transaction
# is handled correctly. Ticket #2994.
#
# Also make sure a virtual table on the right-hand side of an IN operator
# is materialized rather than being used directly. Ticket #3082.
#
#
# $Id: vtabB.test,v 1.1 2008/04/10 18:35:22 drh Exp $
# $Id: vtabB.test,v 1.2 2008/04/25 12:10:15 drh Exp $
set testdir [file dirname $argv0]
source $testdir/tester.tcl
@@ -35,4 +39,41 @@ do_test vtabB-1.1 {
}
} {}
do_test vtabB-2.1 {
execsql {
INSERT INTO t1 VALUES(2);
INSERT INTO t1 VALUES(3);
CREATE TABLE t2(y);
INSERT INTO t2 VALUES(1);
INSERT INTO t2 VALUES(2);
CREATE VIRTUAL TABLE echo_t2 USING echo(t2);
SELECT * FROM t1 WHERE x IN (SELECT rowid FROM t2);
}
} {2}
do_test vtab8-2.2 {
execsql {
SELECT rowid FROM echo_t2
}
} {1 2}
do_test vtabB-2.3 {
execsql {
SELECT * FROM t1 WHERE x IN (SELECT rowid FROM t2);
}
} {2}
do_test vtabB-2.4 {
execsql {
SELECT * FROM t1 WHERE x IN (SELECT rowid FROM echo_t2);
}
} {2}
do_test vtabB-2.5 {
execsql {
SELECT * FROM t1 WHERE x IN (SELECT y FROM t2);
}
} {2}
do_test vtabB-2.6 {
execsql {
SELECT * FROM t1 WHERE x IN (SELECT y FROM echo_t2);
}
} {2}
finish_test