From: danielk1977 Date: Wed, 21 Jun 2006 07:34:11 +0000 (+0000) Subject: Test cases for accessing virtual tables when the corresponding module is undefined... X-Git-Tag: version-3.6.10~2888 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9d1b2a28f82a4406dee245ece668f0243bdbd86e;p=thirdparty%2Fsqlite.git Test cases for accessing virtual tables when the corresponding module is undefined. (CVS 3279) FossilOrigin-Name: bcef48c54dd01cf089db16192e670cb0717988ac --- diff --git a/manifest b/manifest index 7dbc0a6fc3..470dc056dc 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 8cab2de92a..8357e85fb7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -643e63e5883eec109a91a44dae62b58650646575 \ No newline at end of file +bcef48c54dd01cf089db16192e670cb0717988ac \ No newline at end of file diff --git a/src/build.c b/src/build.c index 8e22cb7b3a..84464bfbf8 100644 --- a/src/build.c +++ b/src/build.c @@ -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 @@ -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 diff --git a/test/vtab1.test b/test/vtab1.test index ebc7334588..e6d9d0870d 100644 --- a/test/vtab1.test +++ b/test/vtab1.test @@ -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.* #