]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Remove unused code (that was commented out) from prepare.c. Remove an
authordrh <drh@noemail.net>
Fri, 3 Jul 2009 19:19:50 +0000 (19:19 +0000)
committerdrh <drh@noemail.net>
Fri, 3 Jul 2009 19:19:50 +0000 (19:19 +0000)
incorrect NEVER() macro.  Fix the comment on schemaIsValid() to correctly
describe its return behavior. (CVS 6845)

FossilOrigin-Name: 90deb65835febc908f21bca89ef497d1048afe0a

manifest
manifest.uuid
src/prepare.c

index 803663ae9d6217fa9d61d4a9ec664fb23832c5aa..d0e14bdff2df219f283df8287aee590db08dffb7 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Cause\ssqlite3_exec()\sto\sreturn\sSQLITE_NOMEM\sif\sit\scannot\sallocate\smemory\sto\nhold\sthe\serror\smessage\sfor\ssome\sother\serror.\s(CVS\s6844)
-D 2009-07-03T19:18:43
+C Remove\sunused\scode\s(that\swas\scommented\sout)\sfrom\sprepare.c.\s\sRemove\san\nincorrect\sNEVER()\smacro.\s\sFix\sthe\scomment\son\sschemaIsValid()\sto\scorrectly\ndescribe\sits\sreturn\sbehavior.\s(CVS\s6845)
+D 2009-07-03T19:19:50
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -154,7 +154,7 @@ F src/pcache.c 395f752a13574120bd7513a400ba02a265aaa76d
 F src/pcache.h 9b927ccc5a538e31b4c3bc7eec4f976db42a1324
 F src/pcache1.c 97e7e8e6e34026fb43b47d08532b0c02e959c26c
 F src/pragma.c 9eb44ac1d3dc1ac3ea4f444abe1a10ae8acaa16c
-F src/prepare.c 1f658bc796f2be51b898dc6cc913bca1911ca839
+F src/prepare.c 12e556fc9f72a6563db7099697f657d75d4bb91c
 F src/printf.c 508a1c59433353552b6553cba175eaa7331f8fc1
 F src/random.c 676b9d7ac820fe81e6fb2394ac8c10cff7f38628
 F src/resolve.c 4a61d03e49b15440878096e6030863fc628828f0
@@ -740,7 +740,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
 F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
-P 9e35bec9ef924ec44e87294a549238e0104bb27b
-R 341fe26eb0dd386449a0180ebccb8c6e
+P e9849292ab741f4c86203b2629dbe116f9b527c8
+R 587ce2327c9513e978edc633162d7539
 U drh
-Z f0ad1e3c22a8b7adfeeb6fcc68876a62
+Z bd714fe85ba5b195da90521b32b83698
index 8af0757a69092b2a28f9e6272898ed6a9a0a347f..f767ec128c433f7fd495572511140631c7ab08e2 100644 (file)
@@ -1 +1 @@
-e9849292ab741f4c86203b2629dbe116f9b527c8
\ No newline at end of file
+90deb65835febc908f21bca89ef497d1048afe0a
\ No newline at end of file
index f68b802b394c1b9113eca9b5a3ceb43e7d633e4c..4edbee0ac66f7e53827fd07351252226d48829ae 100644 (file)
@@ -13,7 +13,7 @@
 ** interface, and routines that contribute to loading the database schema
 ** from disk.
 **
-** $Id: prepare.c,v 1.127 2009/07/02 17:21:58 danielk1977 Exp $
+** $Id: prepare.c,v 1.128 2009/07/03 19:19:50 drh Exp $
 */
 #include "sqliteInt.h"
 
@@ -437,7 +437,8 @@ int sqlite3ReadSchema(Parse *pParse){
 
 /*
 ** Check schema cookies in all databases.  If any cookie is out
-** of date, return 0.  If all schema cookies are current, return 1.
+** of date set pParse->rc to SQLITE_SCHEMA.  If all schema cookies
+** make no changes to pParse->rc.
 */
 static void schemaIsValid(Parse *pParse){
   sqlite3 *db = pParse->db;
@@ -457,7 +458,7 @@ static void schemaIsValid(Parse *pParse){
     ** will be closed immediately after reading the meta-value. */
     if( !sqlite3BtreeIsInReadTrans(pBt) ){
       rc = sqlite3BtreeBeginTrans(pBt, 0);
-      if( NEVER(rc==SQLITE_NOMEM) || rc==SQLITE_IOERR_NOMEM ){
+      if( rc==SQLITE_NOMEM || rc==SQLITE_IOERR_NOMEM ){
         db->mallocFailed = 1;
       }
       if( rc!=SQLITE_OK ) return;
@@ -477,36 +478,6 @@ static void schemaIsValid(Parse *pParse){
       sqlite3BtreeCommit(pBt);
     }
   }
-
-#if 0
-  curTemp = (BtCursor *)sqlite3Malloc(sqlite3BtreeCursorSize());
-  if( curTemp ){
-    assert( sqlite3_mutex_held(db->mutex) );
-    for(iDb=0; allOk && iDb<db->nDb; iDb++){
-      Btree *pBt;
-      pBt = db->aDb[iDb].pBt;
-      if( pBt==0 ) continue;
-      memset(curTemp, 0, sqlite3BtreeCursorSize());
-      rc = sqlite3BtreeCursor(pBt, MASTER_ROOT, 0, 0, curTemp);
-      if( rc==SQLITE_OK ){
-        rc = sqlite3BtreeGetMeta(pBt, BTREE_SCHEMA_VERSION, (u32 *)&cookie);
-        if( ALWAYS(rc==SQLITE_OK)
-                && cookie!=db->aDb[iDb].pSchema->schema_cookie ){
-          allOk = 0;
-        }
-        sqlite3BtreeCloseCursor(curTemp);
-      }
-      if( NEVER(rc==SQLITE_NOMEM) || rc==SQLITE_IOERR_NOMEM ){
-        db->mallocFailed = 1;
-      }
-    }
-    sqlite3_free(curTemp);
-  }else{
-    allOk = 0;
-    db->mallocFailed = 1;
-  }
-  return allOk;
-#endif
 }
 
 /*