------BEGIN PGP SIGNED MESSAGE-----
-Hash: SHA1
-
-C Changes\sto\spager\sfor\simproved\stestability.
-D 2010-08-17T17:25:16
+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
F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f
F Makefile.in ec08dc838fd8110fe24c92e5130bcd91cbb1ff2e
F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23
F src/os_os2.c 72d0b2e562952a2464308c4ce5f7913ac10bef3e
F src/os_unix.c 11194cbcf6a57456e58022dc537ab8c3497d9bb9
F src/os_win.c 51cb62f76262d961ea4249489383d714501315a7
-F src/pager.c ddef1e661fbfe6b13d43273c7672485f6fb847cd
+F src/pager.c 10cc26721aa3c34a208247984617a5682abf87c2
F src/pager.h ef8c8f71ab022cc2fff768a1175dd32355be9dcd
F src/parse.y 12b7ebd61ea54f0e1b1083ff69cc2c8ce9353d58
F src/pcache.c 1e9aa2dbc0845b52e1b51cc39753b6d1e041cb07
F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
F tool/vdbe-compress.tcl d70ea6d8a19e3571d7ab8c9b75cba86d1173ff0f
-P ced6a3480fe4a8e2b93160a8419bdc3ab30935e8
-R 19bc85b7e2e305b82c7339594075ff01
-U drh
-Z dae19f7cd7281f0d754f22f429e4dd6e
------BEGIN PGP SIGNATURE-----
-Version: GnuPG v1.4.6 (GNU/Linux)
-
-iD8DBQFMasX/oxKgR168RlERAuYYAJ94C2NzLusQUE3WIvzLfo497U9Q8gCeJk0U
-4T7U1ZESZl2eGMwQ7nWcsfI=
-=+h/y
------END PGP SIGNATURE-----
+P 61c64b3aeb027fcc9c25591d6b9048ac7850ad3d
+R 9b7b35b7a377dabffd9f7024e2c74abc
+U dan
+Z 698fa736824c32720837304d2389e0a8
** is set to zero in all other states. In PAGER_ERROR state, Pager.errCode
** is always set to SQLITE_FULL, SQLITE_IOERR or one of the SQLITE_IOERR_XXX
** sub-codes.
-**
-** If Pager.errCode is set to SQLITE_IOERR or one of its subcodes, then
-** this value is immediately returned when ever any sqlite3PagerXXX() method
-** that returns an error code is called. If it is set to SQLITE_FULL,
-** then it is returned whenever any such sqlite3PagerXXX() method except
-** for PagerAcquire() or PagerLookup() is called.
-**
-** TODO: Review the SQLITE_FULL/PagerAcquire() exception. Is it a good idea?
-** If so, are there bugs whereby shared-cache clients can see
-** uncommitted data when the pager is in the ERROR state?
-**
*/
struct Pager {
sqlite3_vfs *pVfs; /* OS functions to use for IO */
** IOERR sub-codes, the pager enters the ERROR state and the error code
** is stored in Pager.errCode. While the pager remains in the ERROR state,
** all major API calls on the Pager will immediately return Pager.errCode.
-** Except, if the error-code is SQLITE_FULL, calls to PagerLookup() and
-** PagerAcquire are handled as if the pager were in PAGER_READER state.
**
** The ERROR state indicates that the contents of the pager-cache
** cannot be trusted. This state can be cleared by completely discarding
**
** If the pager is in the error state when this function is called, it
** is a no-op. The value returned is the error state error code (i.e.
-** one of SQLITE_IOERR, SQLITE_CORRUPT or SQLITE_FULL).
+** one of SQLITE_IOERR, an SQLITE_IOERR_xxx sub-code or SQLITE_FULL).
**
** Otherwise, if all of the following are true:
**
**
** The following operations are also performed by this function.
**
-** 1) If the pager is currently in PAGER_UNLOCK state (no lock held
+** 1) If the pager is currently in PAGER_OPEN state (no lock held
** on the database file), then an attempt is made to obtain a
** SHARED lock on the database file. Immediately after obtaining
** the SHARED lock, the file-system is checked for a hot-journal,
** the contents of the page cache and rolling back any open journal
** file.
**
-** If the operation described by (2) above is not attempted, and if the
-** pager is in an error state other than SQLITE_FULL when this is called,
-** the error state error code is returned. It is permitted to read the
-** database when in SQLITE_FULL error state.
-**
-** Otherwise, if everything is successful, SQLITE_OK is returned. If an
-** IO error occurs while locking the database, checking for a hot-journal
-** file or rolling back a journal file, the IO error code is returned.
+** If everything is successful, SQLITE_OK is returned. If an IO error
+** occurs while locking the database, checking for a hot-journal file or
+** rolling back a journal file, the IO error code is returned.
*/
int sqlite3PagerSharedLock(Pager *pPager){
int rc = SQLITE_OK; /* Return code */
/* If the pager is in the error state, return an error immediately.
** Otherwise, request the page from the PCache layer. */
- if( pPager->errCode!=SQLITE_OK && pPager->errCode!=SQLITE_FULL ){
+ if( pPager->errCode!=SQLITE_OK ){
rc = pPager->errCode;
}else{
rc = sqlite3PcacheFetch(pPager->pPCache, pgno, 1, ppPage);
/*
** Acquire a page if it is already in the in-memory cache. Do
** not read the page from disk. Return a pointer to the page,
-** or 0 if the page is not in cache. Also, return 0 if the
-** pager is in PAGER_UNLOCK state when this function is called,
-** or if the pager is in an error state other than SQLITE_FULL.
+** or 0 if the page is not in cache.
**
** See also sqlite3PagerGet(). The difference between this routine
** and sqlite3PagerGet() is that _get() will go to the disk and read
assert( pPager!=0 );
assert( pgno!=0 );
assert( pPager->pPCache!=0 );
- assert( pPager->eState>=PAGER_READER );
+ assert( pPager->eState>=PAGER_READER && pPager->eState!=PAGER_ERROR );
sqlite3PcacheFetch(pPager->pPCache, pgno, 0, &pPg);
return pPg;
}
int sqlite3PagerBegin(Pager *pPager, int exFlag, int subjInMemory){
int rc = SQLITE_OK;
- if( pPager->errCode ) return pPager->errCode;
+ if( NEVER(pPager->errCode) ) return pPager->errCode;
assert( pPager->eState>=PAGER_READER && pPager->eState<PAGER_ERROR );
pPager->subjInMemory = (u8)subjInMemory;