]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Don't code an OP_Statement within sqlite3NestedParse(). Also a correction
authordanielk1977 <danielk1977@noemail.net>
Fri, 5 Nov 2004 09:19:27 +0000 (09:19 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Fri, 5 Nov 2004 09:19:27 +0000 (09:19 +0000)
to the UPDATE statement used within destroyRootPage(). (CVS 2064)

FossilOrigin-Name: fdcc31f0c6106dacfed6612b173fe4be3c02546a

manifest
manifest.uuid
src/build.c

index 59584e637fbe5c0728ecc9102adb1ae795ea08fb..628b5d06c717cbfa45082a1c1b4bd69160d1e66f 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C When\susing\ssqlite3NestedParse()\sto\smodify\sthe\ssqlite_master\stable,\sdo\snot\scode\sOP_Callback.\s(CVS\s2063)
-D 2004-11-05T06:02:07
+C Don't\scode\san\sOP_Statement\swithin\ssqlite3NestedParse().\sAlso\sa\scorrection\nto\sthe\sUPDATE\sstatement\sused\swithin\sdestroyRootPage().\s(CVS\s2064)
+D 2004-11-05T09:19:28
 F Makefile.in c4d2416860f472a1e3393714d0372074197565df
 F Makefile.linux-gcc a9e5a0d309fa7c38e7c14d3ecf7690879d3a5457
 F README a01693e454a00cc117967e3f9fdab2d4d52e9bc1
@@ -31,7 +31,7 @@ F src/attach.c e49d09dad9f5f9fb10b4b0c1be5a70ae4c45e689
 F src/auth.c 3b81f2a42f48a62c2c9c9b0eda31a157c681edea
 F src/btree.c f97b5a3919147fe36f776d08c80212ba3ea883aa
 F src/btree.h 3166388fa58c5594d8064d38b43440d79da38fb6
-F src/build.c 06a4eb8f29e9b356f85ff4eac64c112fe5ff7d3d
+F src/build.c dc8b9ab836f2323d9b313c2d703b00b2e9441382
 F src/date.c 34bdb0082db7ec2a83ef00063f7b44e61ee19dad
 F src/delete.c 6a54fd9f0fa6b93e13e40368a8b7206e3aae760c
 F src/expr.c be18081d2959a2cc53846d0fbedfec40fbfa1d6e
@@ -252,7 +252,7 @@ F www/tclsqlite.tcl 560ecd6a916b320e59f2917317398f3d59b7cc25
 F www/vdbe.tcl 59288db1ac5c0616296b26dce071c36cb611dfe9
 F www/version3.tcl 092a01f5ef430d2c4acc0ae558d74c4bb89638a0
 F www/whentouse.tcl fdacb0ba2d39831e8a6240d05a490026ad4c4e4c
-P c46eef2f6d32b8546e1441e7e6f103e6ad97f1f4
-R 6ef3d4d89352eb9cafe604d4c02915f0
+P 296a298c484aac981e7e490a0cb4159717fc4ea4
+R cb8380605519101724d006bec5a8cc07
 U danielk1977
-Z b1ca05da6dffb52204ebc09339eae99e
+Z 36305ac9fc261446032e2140c068e8dd
index be045c788d46551bcf582161400c99152a8aab1d..1b683be49a61bcae33d39e385a80f991290392a2 100644 (file)
@@ -1 +1 @@
-296a298c484aac981e7e490a0cb4159717fc4ea4
\ No newline at end of file
+fdcc31f0c6106dacfed6612b173fe4be3c02546a
\ No newline at end of file
index fcf11f274b52f88cd7910d5766a45a1215399cfc..1a30b0101c9f85005373cd48904f29e20e6ca8bf 100644 (file)
@@ -24,9 +24,9 @@
 **     PRAGMA
 **
 <<<<<<< build.c
-** $Id: build.c,v 1.266 2004/11/05 05:23:59 drh Exp $
+** $Id: build.c,v 1.267 2004/11/05 09:19:28 danielk1977 Exp $
 =======
-** $Id: build.c,v 1.266 2004/11/05 05:23:59 drh Exp $
+** $Id: build.c,v 1.267 2004/11/05 09:19:28 danielk1977 Exp $
 >>>>>>> 1.262
 */
 #include "sqliteInt.h"
@@ -1647,7 +1647,8 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){
   ** The "#0" in the SQL is a special constant that means whatever value
   ** is on the top of the stack.  See sqlite3RegisterExpr().
   */
-  sqlite3NestedParse(pParse, "UPDATE %Q.%Q SET rootpage=#0 WHERE rootpage=%d",
+  sqlite3NestedParse(pParse, 
+     "UPDATE %Q.%Q SET rootpage=%d WHERE #0 AND rootpage=#0",
      pParse->db->aDb[iDb].zName, SCHEMA_TABLE(iDb), iTable);
 #endif
 }
@@ -1659,7 +1660,6 @@ static void destroyRootPage(Parse *pParse, int iTable, int iDb){
 ** is also added (this can happen with an auto-vacuum database).
 */
 static void destroyTable(Parse *pParse, Table *pTab){
-  Vdbe *v = pParse->pVdbe;
 #ifdef SQLITE_OMIT_AUTOVACUUM
   destroyRootPage(pParse, pTab->tnum, pTab->iDb);
   for(pIdx=pTab->pIndex; pIdx; pIdx=pIdx->pNext){
@@ -2687,7 +2687,7 @@ void sqlite3BeginWriteOperation(Parse *pParse, int setStatement, int iDb){
   if( v==0 ) return;
   sqlite3CodeVerifySchema(pParse, iDb);
   pParse->writeMask |= 1<<iDb;
-  if( setStatement ){
+  if( setStatement && pParse->nested==0 ){
     sqlite3VdbeAddOp(v, OP_Statement, iDb, 0);
   }
   if( iDb!=1 && pParse->db->aDb[1].pBt!=0 ){