From: drh Date: Tue, 17 Aug 2010 18:37:12 +0000 (+0000) Subject: It is no longer possible to reach pagerStress() while in the error state, X-Git-Tag: version-3.7.2~25 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=0028486b7346479504b43a5bd5cd0b4e3d4bd907;p=thirdparty%2Fsqlite.git It is no longer possible to reach pagerStress() while in the error state, so put a NEVER() around the error state test of that routine. FossilOrigin-Name: d7ed463496c4474cc435d032874a4e55d780e74a --- diff --git a/manifest b/manifest index 85f61b81d6..64b4b2491e 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,8 @@ -C If\san\sSQLITE_FULL\serror\soccurs\sduring\srollback\sor\sjournal\sfinalization,\streat\sit\sin\sthe\ssame\sway\sas\sSQLITE_IOERR\s(i.e.\srequire\sthat\sthe\spager\sinternals\sbe\scompletely\sreset\sbefore\sit\sis\snext\sread\sfrom\sor\swritten\sto). -D 2010-08-17T18:15:48 +-----BEGIN PGP SIGNED MESSAGE----- +Hash: SHA1 + +C It\sis\sno\slonger\spossible\sto\sreach\spagerStress()\swhile\sin\sthe\serror\sstate,\nso\sput\sa\sNEVER()\saround\sthe\serror\sstate\stest\sof\sthat\sroutine. +D 2010-08-17T18:37:13 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -156,7 +159,7 @@ F src/os_common.h a8f95b81eca8a1ab8593d23e94f8a35f35d4078f F src/os_os2.c 72d0b2e562952a2464308c4ce5f7913ac10bef3e F src/os_unix.c 11194cbcf6a57456e58022dc537ab8c3497d9bb9 F src/os_win.c 51cb62f76262d961ea4249489383d714501315a7 -F src/pager.c 10cc26721aa3c34a208247984617a5682abf87c2 +F src/pager.c db2c8d85ac97610b05e23797fa7b9fe1d146852e F src/pager.h ef8c8f71ab022cc2fff768a1175dd32355be9dcd F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58 F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07 @@ -843,7 +846,14 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f -P 61c64b3aeb027fcc9c25591d6b9048ac7850ad3d -R 9b7b35b7a377dabffd9f7024e2c74abc -U dan -Z 698fa736824c32720837304d2389e0a8 +P 8ac185236e766becdac7248c1ba3dfa42a9464b1 +R 15788ebc670118d1933aed30ce393c67 +U drh +Z 4d416488630bf985a539466ff7ee6ddb +-----BEGIN PGP SIGNATURE----- +Version: GnuPG v1.4.6 (GNU/Linux) + +iD8DBQFMatbcoxKgR168RlERAiVJAKCLNKPoYvUl5GoHta8oDcjdGJE8mACfZs+E +8kxI6koAtXdn/nw0mMZtkgg= +=Gyit +-----END PGP SIGNATURE----- diff --git a/manifest.uuid b/manifest.uuid index 67197d5111..f57abe519a 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -8ac185236e766becdac7248c1ba3dfa42a9464b1 \ No newline at end of file +d7ed463496c4474cc435d032874a4e55d780e74a \ No newline at end of file diff --git a/src/pager.c b/src/pager.c index caf3681cf6..31f5acdb47 100644 --- a/src/pager.c +++ b/src/pager.c @@ -4053,9 +4053,14 @@ static int pagerStress(void *p, PgHdr *pPg){ ** The doNotSpill flag inhibits all cache spilling regardless of whether ** or not a sync is required. This is set during a rollback. ** - ** Spilling is also inhibited when in an error state. + ** Spilling is also prohibited when in an error state since that could + ** lead to database corruption. In the current implementaton it + ** is impossible for sqlite3PCacheFetch() to be called with createFlag==1 + ** while in the error state, hence it is impossible for this routine to + ** be called in the error state. Nevertheless, we include a NEVER() + ** test for the error state as a safeguard against future changes. */ - if( pPager->errCode ) return SQLITE_OK; + if( NEVER(pPager->errCode) ) return SQLITE_OK; if( pPager->doNotSpill ) return SQLITE_OK; if( pPager->doNotSyncSpill && (pPg->flags & PGHDR_NEED_SYNC)!=0 ){ return SQLITE_OK;