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 inserting into virtual tables from a SELECT
15 # $Id: vtab8.test,v 1.2 2007/03/02 08:12:23 danielk1977 Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
25 register_echo_module [sqlite3_connection_pointer db]
29 do_test vtab1.2244-1 {
31 CREATE TABLE t2244(a, b);
32 CREATE VIRTUAL TABLE t2244e USING echo(t2244);
33 INSERT INTO t2244 VALUES('AA', 'BB');
34 INSERT INTO t2244 VALUES('CC', 'DD');
35 SELECT rowid, * FROM t2244e;
38 do_test vtab1.2244-2 {
40 SELECT * FROM t2244e WHERE rowid = 10;
43 do_test vtab1.2244-3 {
45 UPDATE t2244e SET a = 'hello world' WHERE 0;
46 SELECT rowid, * FROM t2244e;
50 do_test vtab1-2250-2 {
52 CREATE TABLE t2250(a, b);
53 INSERT INTO t2250 VALUES(10, 20);
54 CREATE VIRTUAL TABLE t2250e USING echo(t2250);
55 select max(rowid) from t2250;
56 select max(rowid) from t2250e;
62 do_test vtab1.2260-1 {
64 CREATE TABLE t2260a_real(a, b);
65 CREATE TABLE t2260b_real(a, b);
67 CREATE INDEX i2260 ON t2260a_real(a);
68 CREATE INDEX i2260x ON t2260b_real(a);
70 CREATE VIRTUAL TABLE t2260a USING echo(t2260a_real);
71 CREATE VIRTUAL TABLE t2260b USING echo(t2260b_real);
73 SELECT * FROM t2260a, t2260b WHERE t2260a.a = t2260b.a AND t2260a.a > 101;
77 unset -nocomplain echo_module_begin_fail