3 # The author disclaims copyright to this source code. In place of
4 # a legal notice, here is a blessing:
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.
10 #***********************************************************************
11 # This file implements regression tests for SQLite library. The
12 # focus of this file is is verifying that a virtual table in the
13 # TEMP database that is created and dropped within a transaction
14 # is handled correctly. Ticket #2994.
16 # Also make sure a virtual table on the right-hand side of an IN operator
17 # is materialized rather than being used directly. Ticket #3082.
21 # $Id: vtabB.test,v 1.2 2008/04/25 12:10:15 drh Exp $
23 set testdir [file dirname $argv0]
24 source $testdir/tester.tcl
32 register_echo_module [sqlite3_connection_pointer db]
36 CREATE VIRTUAL TABLE temp.echo_test1 USING echo(t1);
37 DROP TABLE echo_test1;
44 INSERT INTO t1 VALUES(2);
45 INSERT INTO t1 VALUES(3);
47 INSERT INTO t2 VALUES(1);
48 INSERT INTO t2 VALUES(2);
49 CREATE VIRTUAL TABLE echo_t2 USING echo(t2);
50 SELECT * FROM t1 WHERE x IN (SELECT rowid FROM t2);
55 SELECT rowid FROM echo_t2
60 SELECT * FROM t1 WHERE x IN (SELECT rowid FROM t2);
65 SELECT * FROM t1 WHERE x IN (SELECT rowid FROM echo_t2);
70 SELECT * FROM t1 WHERE x IN (SELECT y FROM t2);
75 SELECT * FROM t1 WHERE x IN (SELECT y FROM echo_t2);