]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Add tests to create and drop a virtual table during a recursive call from
authordrh <drh@noemail.net>
Mon, 28 Apr 2008 17:12:10 +0000 (17:12 +0000)
committerdrh <drh@noemail.net>
Mon, 28 Apr 2008 17:12:10 +0000 (17:12 +0000)
an application-defined function.  Ticket #3080. (CVS 5061)

FossilOrigin-Name: d4d6eff353edd5680776436ab3406227b8c830b3

manifest
manifest.uuid
test/tkt3080.test [new file with mode: 0644]

index b88de430cbe62fe9f7b3b1b873d6a0a3ef5a3eb0..c05af60de940830ba23a586a0a762d6767709a4b 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Change\sthe\simplementation\sof\sthe\sNaN\srecognition\sto\sbe\smore\scross-platform.\nTicket\s#3089.\s(CVS\s5060)
-D 2008-04-28T16:55:26
+C Add\stests\sto\screate\sand\sdrop\sa\svirtual\stable\sduring\sa\srecursive\scall\sfrom\nan\sapplication-defined\sfunction.\s\sTicket\s#3080.\s(CVS\s5061)
+D 2008-04-28T17:12:11
 F Makefile.arm-wince-mingw32ce-gcc ac5f7b2cef0cd850d6f755ba6ee4ab961b1fadf7
 F Makefile.in 25b3282a4ac39388632c2fb0e044ff494d490952
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -501,6 +501,7 @@ F test/tkt2854.test aebd5a9904d36d1ef7a074fc5e7c7da3ab00c32a
 F test/tkt2920.test a8737380e4ae6424e00c0273dc12775704efbebf
 F test/tkt2927.test 492c6a9a14b2fc7bdbb17ce8e497d82df627f64d
 F test/tkt2942.test c5c87d179799ca6d1fbe83c815510b87cd5ec7ce
+F test/tkt3080.test 31a02e87a4c80ed443831c2c5b0e8216ff95ac14
 F test/trace.test 951cd0f5f571e7f36bf7bfe04be70f90fb16fb00
 F test/trans.test 2fd24cd7aa0b879d49a224cbd647d698f1e7ac5c
 F test/trigger1.test 7c13f39ca36f529bf856e05c7d004fc0531d48b4
@@ -630,7 +631,7 @@ F www/tclsqlite.tcl 8be95ee6dba05eabcd27a9d91331c803f2ce2130
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl fc46eae081251c3c181bd79c5faef8195d7991a5
-P 20946bf6dd704416c41edd863103e85fc7ab4ef2
-R 80368d71b836d83e7f2e7f2f1d8e19df
+P 07fd9a8c6ca0876f7ec447ce65173957005dc75c
+R 24b6d0f59b258269d57fca07ceb30dbf
 U drh
-Z 00d3002a00844183e10c99274d36883e
+Z 75f1283ab24ae4d1a6f389ac69754bf0
index c9448b3dc49c8968dca57f9fa8993ec67d793089..d87438bccb1c758e76ab89a878eb78ea827988e7 100644 (file)
@@ -1 +1 @@
-07fd9a8c6ca0876f7ec447ce65173957005dc75c
\ No newline at end of file
+d4d6eff353edd5680776436ab3406227b8c830b3
\ No newline at end of file
diff --git a/test/tkt3080.test b/test/tkt3080.test
new file mode 100644 (file)
index 0000000..d03a383
--- /dev/null
@@ -0,0 +1,77 @@
+# 2008 April 27
+#
+# The author disclaims copyright to this source code.  In place of
+# a legal notice, here is a blessing:
+#
+#    May you do good and not evil.
+#    May you find forgiveness for yourself and forgive others.
+#    May you share freely, never taking more than you give.
+#
+#***********************************************************************
+#
+# Ticket #3080
+#
+# Make sure that application-defined functions are able to recursively
+# invoke SQL statements that create and drop virtual tables.
+#
+# $Id: tkt3080.test,v 1.1 2008/04/28 17:12:11 drh Exp $
+#
+
+set testdir [file dirname $argv0]
+source $testdir/tester.tcl
+
+do_test tkt3080.1 {
+  db function execsql execsql
+  db eval {
+    SELECT execsql('CREATE TABLE t1(x)');
+  }
+  execsql {SELECT name FROM sqlite_master}
+} {t1}
+do_test tkt3080.2 {
+  db eval {
+    INSERT INTO t1 VALUES('CREATE TABLE t2(y);');
+    SELECT execsql(x) FROM t1;
+  }
+  db eval {
+    SELECT name FROM sqlite_master;
+  }
+} {t1 t2}
+do_test tkt3080.3 {
+  execsql {
+    INSERT INTO t1 VALUES('CREATE TABLE t3(z); DROP TABLE t3;');
+  }
+  catchsql {
+    SELECT execsql(x) FROM t1 WHERE rowid=2;
+  }
+} {1 {database table is locked}}
+do_test tkt3080.4 {
+  db eval {
+    SELECT name FROM sqlite_master;
+  }
+} {t1 t2}
+
+ifcapable vtab {
+  register_echo_module [sqlite3_connection_pointer db]
+  do_test tkt3080.10 {
+     set sql {
+       CREATE VIRTUAL TABLE t4 USING echo(t2);
+       INSERT INTO t4 VALUES(123);
+       DROP TABLE t4;
+     }
+     execsql {
+       DELETE FROM t1;
+       INSERT INTO t1 VALUES($sql);
+     }
+     db eval {
+       SELECT execsql(x) FROM t1
+     }
+     execsql {SELECT name FROM sqlite_master}
+  } {t1 t2}
+  do_test tkt3080.11 {
+     execsql {SELECT * FROM t2}
+  } {123}
+}
+  
+
+
+finish_test