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: vtab9.test,v 1.2 2007/04/16 15:06:26 danielk1977 Exp $
17 set testdir [file dirname $argv0]
18 source $testdir/tester.tcl
26 register_echo_module [sqlite3_connection_pointer db]
29 CREATE VIRTUAL TABLE t1 USING echo(t0);
30 INSERT INTO t1 SELECT 'hello';
31 SELECT rowid, * FROM t1;
37 CREATE TABLE t2(a,b,c);
38 CREATE VIRTUAL TABLE t3 USING echo(t2);
39 CREATE TABLE d1(a,b,c);
40 INSERT INTO d1 VALUES(1,2,3);
41 INSERT INTO d1 VALUES('a','b','c');
42 INSERT INTO d1 VALUES(NULL,'x',123.456);
43 INSERT INTO d1 VALUES(x'6869',123456789,-12345);
44 INSERT INTO t3(a,b,c) SELECT * FROM d1;
45 SELECT rowid, * FROM t3;
47 } {1 1 2 3 2 a b c 3 {} x 123.456 4 hi 123456789 -12345}
52 # CREATE VIRTUAL TABLE t5 USING echo(t4);
53 # INSERT INTO t4 VALUES('hello');
54 # SELECT rowid, a FROM t5;
59 # INSERT INTO t5(rowid, a) VALUES(1, 'goodbye');
64 # REPLACE INTO t5(rowid, a) VALUES(1, 'goodbye');
69 unset -nocomplain echo_module_begin_fail