]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Test cases for accessing virtual tables when the corresponding module is undefined...
authordanielk1977 <danielk1977@noemail.net>
Wed, 21 Jun 2006 07:34:11 +0000 (07:34 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 21 Jun 2006 07:34:11 +0000 (07:34 +0000)
FossilOrigin-Name: bcef48c54dd01cf089db16192e670cb0717988ac

manifest
manifest.uuid
src/build.c
test/vtab1.test

index 7dbc0a6fc36a49d8291180b83a0307ef02d5024e..470dc056dc345232e418b88c2698cccd9866f0de 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Fix\sa\sproblem\swith\svirtual\stables\sand\sjoins.\s(CVS\s3278)
-D 2006-06-21T07:02:33
+C Test\scases\sfor\saccessing\svirtual\stables\swhen\sthe\scorresponding\smodule\sis\sundefined.\s(CVS\s3279)
+D 2006-06-21T07:34:11
 F Makefile.in f839b470345d3cb4b0644068474623fe2464b5d3
 F Makefile.linux-gcc 2d8574d1ba75f129aba2019f0b959db380a90935
 F README 9c4e2d6706bdcc3efdd773ce752a8cdab4f90028
@@ -36,7 +36,7 @@ F src/attach.c 27a31d3b89d7ebb5b358847607b1ec795384123c
 F src/auth.c 902f4722661c796b97f007d9606bd7529c02597f
 F src/btree.c ed343b3dbcbc7da9ac481ef2b98c4239fe6d9629
 F src/btree.h 40055cfc09defd1146bc5b922399c035f969e56d
-F src/build.c ef7debea37252a5bdc3dd88f45d3016a9fb27d0a
+F src/build.c 467944d9b0dc1483a50e5ee0f0771e0e53264c43
 F src/callback.c fd9bb39f7ff6b52bad8365617abc61c720640429
 F src/complete.c 7d1a44be8f37de125fcafd3d3a018690b3799675
 F src/date.c cd2bd5d1ebc6fa12d6312f69789ae5b0a2766f2e
@@ -291,7 +291,7 @@ F test/vacuum.test 37f998b841cb335397c26d9bbc3457182af2565f
 F test/vacuum2.test 5aea8c88a65cb29f7d175296e7c819c6158d838c
 F test/varint.test ab7b110089a08b9926ed7390e7e97bdefeb74102
 F test/view.test 16e2774fe35e47a07ac4471b7f0bcc948b1aa6d5
-F test/vtab1.test ab6cf2670f769efc0ac8a7d8c272f910da296dbc
+F test/vtab1.test a4a613abd0dc3d89e6c3850c8fdaf21b3235900b
 F test/vtab2.test e57f9865368df26ef5eb8bc630962d82086f174b
 F test/vtab3.test f38d6d7d19f08bffdadce4d5b8cba078f8118587
 F test/vtab4.test 4b4293341443839ef6dc02f8d9e614702a6c67ff
@@ -372,7 +372,7 @@ F www/tclsqlite.tcl bb0d1357328a42b1993d78573e587c6dcbc964b9
 F www/vdbe.tcl 87a31ace769f20d3627a64fa1fade7fed47b90d0
 F www/version3.tcl 890248cf7b70e60c383b0e84d77d5132b3ead42b
 F www/whentouse.tcl 97e2b5cd296f7d8057e11f44427dea8a4c2db513
-P 3e19a7d8eabcd2fa71ced3f76c5f9bc1f3900b81
-R dd2e65c82fc19b7cf06d61c3f62a9682
+P 643e63e5883eec109a91a44dae62b58650646575
+R 5df237ae1d0f32a0a5347808bfb7d55a
 U danielk1977
-Z 403c1a151f48024ee7e51bb28ac7757a
+Z 155064465a7da1b6e1f61624d89bfddf
index 8cab2de92aa5b16a63f8238c8be9d3f912bcbb3f..8357e85fb7e276b0cd1ff59de7d34d33e041f3f4 100644 (file)
@@ -1 +1 @@
-643e63e5883eec109a91a44dae62b58650646575
\ No newline at end of file
+bcef48c54dd01cf089db16192e670cb0717988ac
\ No newline at end of file
index 8e22cb7b3a6ab875ac7e8d8d7c252d2b2a5d63e8..84464bfbf870af65f86c01410e617bbae621e867 100644 (file)
@@ -22,7 +22,7 @@
 **     COMMIT
 **     ROLLBACK
 **
-** $Id: build.c,v 1.405 2006/06/20 11:01:07 danielk1977 Exp $
+** $Id: build.c,v 1.406 2006/06/21 07:34:11 danielk1977 Exp $
 */
 #include "sqliteInt.h"
 #include <ctype.h>
@@ -1905,6 +1905,9 @@ void sqlite3DropTable(Parse *pParse, SrcList *pName, int isView, int noErr){
       }
 #ifndef SQLITE_OMIT_VIRTUALTABLE
     }else if( IsVirtual(pTab) ){
+      if( sqlite3ViewGetColumnNames(pParse, pTab) ){
+        goto exit_drop_table;
+      }
       code = SQLITE_DROP_VTABLE;
       zArg2 = pTab->pMod->zName;
 #endif
index ebc7334588a75d132e9a9c5c3118f0b79649af54..e6d9d0870d1fdcf2de39fc4213bee5e0ced912e9 100644 (file)
@@ -11,7 +11,7 @@
 # This file implements regression tests for SQLite library.  The
 # focus of this file is creating and dropping virtual tables.
 #
-# $Id: vtab1.test,v 1.25 2006/06/21 07:02:34 danielk1977 Exp $
+# $Id: vtab1.test,v 1.26 2006/06/21 07:34:11 danielk1977 Exp $
 
 set testdir [file dirname $argv0]
 source $testdir/tester.tcl
@@ -118,6 +118,52 @@ do_test vtab1-1.9 {
   }
 } {}
 
+do_test vtab1-1.10 {
+  execsql {
+    CREATE TABLE treal(a, b, c);
+    CREATE VIRTUAL TABLE techo USING echo(treal);
+  }
+  db close
+  sqlite3 db test.db
+  catchsql {
+    SELECT * FROM techo;
+  }
+} {1 {no such module: echo}}
+do_test vtab1-1.11 {
+  catchsql {
+    INSERT INTO techo VALUES(1, 2, 3);
+  }
+} {1 {no such module: echo}}
+do_test vtab1-1.12 {
+  catchsql {
+    UPDATE techo SET a = 10;
+  }
+} {1 {no such module: echo}}
+do_test vtab1-1.13 {
+  catchsql {
+    DELETE FROM techo;
+  }
+} {1 {no such module: echo}}
+do_test vtab1-1.14 {
+  catchsql {
+    PRAGMA table_info(techo)
+  }
+} {1 {no such module: echo}}
+do_test vtab1-1.15 {
+  catchsql {
+    DROP TABLE techo;
+  }
+} {1 {no such module: echo}}
+
+register_echo_module [sqlite3_connection_pointer db]
+do_test vtab1-1.X {
+  execsql {
+    DROP TABLE techo;
+    DROP TABLE treal;
+    SELECT sql FROM sqlite_master;
+  }
+} {}
+
 #----------------------------------------------------------------------
 # Test cases vtab1.2.*
 #