From: drh Date: Tue, 20 Jan 2004 11:54:03 +0000 (+0000) Subject: Make ATTACH and DETACH work with the non-callback API. Ticket #574. (CVS 1194) X-Git-Tag: version-3.6.10~4874 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=0bca353087397e39ba751201e8a1b072b82e72f7;p=thirdparty%2Fsqlite.git Make ATTACH and DETACH work with the non-callback API. Ticket #574. (CVS 1194) FossilOrigin-Name: c32a80fe3cd6dda5238e59bd48d9dd22b4856304 --- diff --git a/manifest b/manifest index 48be08e0f8..b40a824b1c 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C documented\spragma\sforeign_key_list().\nupdated\sdocs\sfor\sremoved\sbehavior:\sOracle\sjoin\ssyntax\sand\stemp\sindexes.\s(CVS\s1193) -D 2004-01-19T05:09:24 +C Make\sATTACH\sand\sDETACH\swork\swith\sthe\snon-callback\sAPI.\s\sTicket\s#574.\s(CVS\s1194) +D 2004-01-20T11:54:03 F Makefile.in 0515ff9218ad8d5a8f6220f0494b8ef94c67013b F Makefile.linux-gcc b86a99c493a5bfb402d1d9178dcdc4bd4b32f906 F README f1de682fbbd94899d50aca13d387d1b3fd3be2dd @@ -21,7 +21,7 @@ F publish.sh 86b5e8535830a2588f62ce1d5d1ef00e1dede23a F spec.template a38492f1c1dd349fc24cb0565e08afc53045304b F sqlite.1 83f4a9d37bdf2b7ef079a82d54eaf2e3509ee6ea F sqlite.pc.in 30552343140c53304c2a658c080fbe810cd09ca2 -F src/attach.c 9a3764bbccb1c8b39321630006fbaa0fb8bd1822 +F src/attach.c 4a0a3c0885fec11a0a199a8031694d08925d0a27 F src/auth.c c59ad0dab501888f8b1fccc25e2f5965d2265116 F src/btree.c 9ab30f0504ef69ba4cba2f264d8096c5abc2b7b8 F src/btree.h 9b7c09f1e64274d7bb74a57bbfc63778f67b1048 @@ -68,7 +68,7 @@ F src/vdbeaux.c dae9f8de7140daebbd621bfccb0982e17c352a9f F src/where.c 1302d728bd338c237e6a8282e4e3eadbbdf11e45 F test/all.test 569a92a8ee88f5300c057cc4a8f50fbbc69a3242 F test/attach.test c26848402e7ac829e043e1fa5e0eb87032e5d81d -F test/attach2.test d0105f4e8b1debf0ac25ed7df986b5854620e172 +F test/attach2.test b1baa766fe5bf82d9a58dbbcf3d4549274190f7d F test/auth.test 5c4d95cdaf539c0c236e20ce1f71a93e7dde9185 F test/bigfile.test ea904b853ce2d703b16c5ce90e2b54951bc1ae81 F test/bigrow.test 8ab252dba108f12ad64e337b0f2ff31a807ac578 @@ -180,7 +180,7 @@ F www/speed.tcl 2f6b1155b99d39adb185f900456d1d592c4832b3 F www/sqlite.tcl 3c83b08cf9f18aa2d69453ff441a36c40e431604 F www/tclsqlite.tcl b9271d44dcf147a93c98f8ecf28c927307abd6da F www/vdbe.tcl 9b9095d4495f37697fd1935d10e14c6015e80aa1 -P 7972ee321974380a59fef752f5643d98f9df38cc -R cb442edf5997c7f37f655ba9608aaa0e -U jplyon -Z dfc89bf5caf4326de0e59dc76182fec8 +P 06bd5070966b59730a91bc4d384df4f8abaadd37 +R db0168bfb38286739612cc530b62e2a3 +U drh +Z 487bc0f292ec397b099632de39d84b77 diff --git a/manifest.uuid b/manifest.uuid index faf816b4ec..7c61c0af62 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -06bd5070966b59730a91bc4d384df4f8abaadd37 \ No newline at end of file +c32a80fe3cd6dda5238e59bd48d9dd22b4856304 \ No newline at end of file diff --git a/src/attach.c b/src/attach.c index b5db1298cb..be5ec6ebfe 100644 --- a/src/attach.c +++ b/src/attach.c @@ -11,7 +11,7 @@ ************************************************************************* ** This file contains code used to implement the ATTACH and DETACH commands. ** -** $Id: attach.c,v 1.8 2003/12/06 22:22:36 drh Exp $ +** $Id: attach.c,v 1.9 2004/01/20 11:54:03 drh Exp $ */ #include "sqliteInt.h" @@ -28,7 +28,10 @@ void sqliteAttach(Parse *pParse, Token *pFilename, Token *pDbname){ int rc, i; char *zFile, *zName; sqlite *db; + Vdbe *v; + v = sqliteGetVdbe(pParse); + sqliteVdbeAddOp(v, OP_Halt, 0, 0); if( pParse->explain ) return; db = pParse->db; if( db->file_format<4 ){ @@ -117,7 +120,10 @@ void sqliteAttach(Parse *pParse, Token *pFilename, Token *pDbname){ void sqliteDetach(Parse *pParse, Token *pDbname){ int i; sqlite *db; + Vdbe *v; + v = sqliteGetVdbe(pParse); + sqliteVdbeAddOp(v, OP_Halt, 0, 0); if( pParse->explain ) return; db = pParse->db; for(i=0; inDb; i++){ diff --git a/test/attach2.test b/test/attach2.test index 271ccf4d3e..49e2b89af2 100644 --- a/test/attach2.test +++ b/test/attach2.test @@ -12,7 +12,7 @@ # focus of this script is testing the ATTACH and DETACH commands # and related functionality. # -# $Id: attach2.test,v 1.3 2003/12/06 22:22:37 drh Exp $ +# $Id: attach2.test,v 1.4 2004/01/20 11:54:03 drh Exp $ # @@ -118,6 +118,24 @@ do_test attach2-2.12 { } } {1 {cannot commit - no transaction is active}} +# Ticket #574: Make sure it works usingi the non-callback API +# +do_test attach2-3.1 { + db close + db2 eval ROLLBACK + set DB [sqlite db test.db] + set rc [catch {sqlite_compile $DB "ATTACH 'test2.db' AS t2" TAIL} VM] + if {$rc} {lappend rc $VM} + sqlite_finalize $VM + set rc +} {0} +do_test attach2-3.2 { + set rc [catch {sqlite_compile $DB "DETACH t2" TAIL} VM] + if {$rc} {lappend rc $VM} + sqlite_finalize $VM + set rc +} {0} + db close for {set i 2} {$i<=15} {incr i} { catch {db$i close}