mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Change an unreachable condition in PagerSharedLock to a NEVER(...). Add an assert to pager_error() to show that it is never called to put an in-memory pager to the error-state. (CVS 6941)
FossilOrigin-Name: 1d931f77519baf3586708c77cbd161c0e75bcbaf
This commit is contained in:
14
manifest
14
manifest
@@ -1,5 +1,5 @@
|
|||||||
C Change\sa\scondition\sto\sa\s'%'\soperator\sin\sbitvec.c.\s(CVS\s6940)
|
C Change\san\sunreachable\scondition\sin\sPagerSharedLock\sto\sa\sNEVER(...).\sAdd\san\sassert\sto\spager_error()\sto\sshow\sthat\sit\sis\snever\scalled\sto\sput\san\sin-memory\spager\sto\sthe\serror-state.\s(CVS\s6941)
|
||||||
D 2009-07-25T17:33:26
|
D 2009-07-25T17:39:14
|
||||||
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
|
||||||
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
F Makefile.in df9359da7a726ccb67a45db905c5447d5c00c6ef
|
||||||
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
|
||||||
@@ -147,7 +147,7 @@ F src/os_common.h 8c61457df58f1a4bd5f5adc3e90e01b37bf7afbc
|
|||||||
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
F src/os_os2.c bed77dc26e3a95ce4a204936b9a1ca6fe612fcc5
|
||||||
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
F src/os_unix.c cdb2a08b9ce4aa13b3f7b91d4dd60fb48be9f56a
|
||||||
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
F src/os_win.c 725c38a524d168ce280446ad8761d731bc516405
|
||||||
F src/pager.c e9d23aef33b7669ab7df24070d371f7e5d21cca1
|
F src/pager.c f050740b628e564d10b7269170f7c62e91286a84
|
||||||
F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
|
F src/pager.h 11852d044c86cf5a9d6e34171fb0c4fcf1f6265f
|
||||||
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
F src/parse.y bcd46d43fbd23a22b8c020a3eb1806b794794ed5
|
||||||
F src/pcache.c c92ffd4f3e1279b3766854c6d18b5bf4aac0d1fa
|
F src/pcache.c c92ffd4f3e1279b3766854c6d18b5bf4aac0d1fa
|
||||||
@@ -738,7 +738,7 @@ F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
|
|||||||
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
|
||||||
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
|
||||||
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
F tool/vdbe-compress.tcl 672f81d693a03f80f5ae60bfefacd8a349e76746
|
||||||
P 533d6cc67a3b6467db5b83c5ca535d229d36ad27
|
P 10250fe5c039dbef2e1614e6320f7bd354c10211
|
||||||
R b24dc1060c0e41c7234c2870603ba4a6
|
R 99775dd1d9caf07f15aac6d35493d7a6
|
||||||
U drh
|
U danielk1977
|
||||||
Z 737abbbb5ad16338e62e8e8aa8bd1e9e
|
Z 48c380c40fd307d2d3f58af91056b3e0
|
||||||
|
@@ -1 +1 @@
|
|||||||
10250fe5c039dbef2e1614e6320f7bd354c10211
|
1d931f77519baf3586708c77cbd161c0e75bcbaf
|
14
src/pager.c
14
src/pager.c
@@ -18,7 +18,7 @@
|
|||||||
** file simultaneously, or one process from reading the database while
|
** file simultaneously, or one process from reading the database while
|
||||||
** another is writing.
|
** another is writing.
|
||||||
**
|
**
|
||||||
** @(#) $Id: pager.c,v 1.624 2009/07/25 17:08:36 drh Exp $
|
** @(#) $Id: pager.c,v 1.625 2009/07/25 17:39:14 danielk1977 Exp $
|
||||||
*/
|
*/
|
||||||
#ifndef SQLITE_OMIT_DISKIO
|
#ifndef SQLITE_OMIT_DISKIO
|
||||||
#include "sqliteInt.h"
|
#include "sqliteInt.h"
|
||||||
@@ -1174,6 +1174,7 @@ static void pager_unlock(Pager *pPager){
|
|||||||
*/
|
*/
|
||||||
static int pager_error(Pager *pPager, int rc){
|
static int pager_error(Pager *pPager, int rc){
|
||||||
int rc2 = rc & 0xff;
|
int rc2 = rc & 0xff;
|
||||||
|
assert( rc==SQLITE_OK || !MEMDB );
|
||||||
assert(
|
assert(
|
||||||
pPager->errCode==SQLITE_FULL ||
|
pPager->errCode==SQLITE_FULL ||
|
||||||
pPager->errCode==SQLITE_OK ||
|
pPager->errCode==SQLITE_OK ||
|
||||||
@@ -3597,12 +3598,13 @@ int sqlite3PagerSharedLock(Pager *pPager){
|
|||||||
/* This routine is only called from b-tree and only when there are no
|
/* This routine is only called from b-tree and only when there are no
|
||||||
** outstanding pages */
|
** outstanding pages */
|
||||||
assert( sqlite3PcacheRefCount(pPager->pPCache)==0 );
|
assert( sqlite3PcacheRefCount(pPager->pPCache)==0 );
|
||||||
|
if( NEVER(MEMDB && pPager->errCode) ){ return pPager->errCode; }
|
||||||
|
|
||||||
/* If this database is in an error-state, now is a chance to clear
|
/* If this database is in an error-state, now is a chance to clear
|
||||||
** the error. Discard the contents of the pager-cache and rollback
|
** the error. Discard the contents of the pager-cache and rollback
|
||||||
** any hot journal in the file-system.
|
** any hot journal in the file-system.
|
||||||
*/
|
*/
|
||||||
if( !MEMDB && pPager->errCode ){
|
if( pPager->errCode ){
|
||||||
if( isOpen(pPager->jfd) || pPager->zJournal ){
|
if( isOpen(pPager->jfd) || pPager->zJournal ){
|
||||||
isErrorReset = 1;
|
isErrorReset = 1;
|
||||||
}
|
}
|
||||||
@@ -3610,14 +3612,6 @@ int sqlite3PagerSharedLock(Pager *pPager){
|
|||||||
pager_reset(pPager);
|
pager_reset(pPager);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* If the pager is still in an error state, do not proceed. The error
|
|
||||||
** state will be cleared at some point in the future when all page
|
|
||||||
** references are dropped and the cache can be discarded.
|
|
||||||
*/
|
|
||||||
if( pPager->errCode && pPager->errCode!=SQLITE_FULL ){
|
|
||||||
return pPager->errCode;
|
|
||||||
}
|
|
||||||
|
|
||||||
if( pPager->state==PAGER_UNLOCK || isErrorReset ){
|
if( pPager->state==PAGER_UNLOCK || isErrorReset ){
|
||||||
sqlite3_vfs * const pVfs = pPager->pVfs;
|
sqlite3_vfs * const pVfs = pPager->pVfs;
|
||||||
int isHotJournal = 0;
|
int isHotJournal = 0;
|
||||||
|
Reference in New Issue
Block a user