From: drh Date: Fri, 3 Jul 2009 19:19:50 +0000 (+0000) Subject: Remove unused code (that was commented out) from prepare.c. Remove an X-Git-Tag: cvs-to-fossil-cutover~127 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=1adecdf8140801e889c7a96240520dd3addd4550;p=thirdparty%2Fsqlite.git Remove unused code (that was commented out) from prepare.c. Remove an incorrect NEVER() macro. Fix the comment on schemaIsValid() to correctly describe its return behavior. (CVS 6845) FossilOrigin-Name: 90deb65835febc908f21bca89ef497d1048afe0a --- diff --git a/manifest b/manifest index 803663ae9d..d0e14bdff2 100644 --- 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 diff --git a/manifest.uuid b/manifest.uuid index 8af0757a69..f767ec128c 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e9849292ab741f4c86203b2629dbe116f9b527c8 \ No newline at end of file +90deb65835febc908f21bca89ef497d1048afe0a \ No newline at end of file diff --git a/src/prepare.c b/src/prepare.c index f68b802b39..4edbee0ac6 100644 --- a/src/prepare.c +++ b/src/prepare.c @@ -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 && iDbnDb; 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 } /*