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 #***********************************************************************
14 # Make sure that application-defined functions are able to recursively
15 # invoke SQL statements that create and drop virtual tables.
17 # $Id: tkt3080.test,v 1.2 2008/11/05 16:37:35 drh Exp $
20 set testdir [file dirname $argv0]
21 source $testdir/tester.tcl
24 db function execsql execsql
26 SELECT execsql('CREATE TABLE t1(x)');
28 execsql {SELECT name FROM sqlite_master}
32 INSERT INTO t1 VALUES('CREATE TABLE t2(y);');
33 SELECT execsql(x) FROM t1;
36 SELECT name FROM sqlite_master;
41 INSERT INTO t1 VALUES('CREATE TABLE t3(z); DROP TABLE t3;');
44 SELECT execsql(x) FROM t1 WHERE rowid=2;
46 } {1 {database table is locked}}
49 SELECT name FROM sqlite_master;
54 register_echo_module [sqlite3_connection_pointer db]
57 CREATE VIRTUAL TABLE t4 USING echo(t2);
58 INSERT INTO t4 VALUES(123);
63 INSERT INTO t1 VALUES($sql);
66 SELECT execsql(x) FROM t1
68 execsql {SELECT name FROM sqlite_master}
71 execsql {SELECT * FROM t2}