aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2010-05-25 02:24:01 +0000
committerdrh <drh@noemail.net>2010-05-25 02:24:01 +0000
commit82043b3077686ca1954b63ef971ef71dae34a91a (patch)
tree5c814d668a76cae64f6959c12aa598219375e7b6 /src
parentf53303573a5806015c43b8214a8e24693351ff80 (diff)
downloadsqlite-82043b3077686ca1954b63ef971ef71dae34a91a.tar.gz
sqlite-82043b3077686ca1954b63ef971ef71dae34a91a.zip
Remove unreachable code associated with WAL from the pager.
FossilOrigin-Name: 54c1718e6d15a20414cae15895eb5e83217722e2
Diffstat (limited to 'src')
-rw-r--r--src/pager.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/src/pager.c b/src/pager.c
index beb2b2dfc..5a3d35f7f 100644
--- a/src/pager.c
+++ b/src/pager.c
@@ -2392,18 +2392,15 @@ static int pagerOpenSnapshot(Pager *pPager){
*/
static int pagerHasWAL(Pager *pPager, int *pExists){
int rc; /* Return code */
+ char *zWal; /* Name of the WAL file */
- if( !pPager->tempFile ){
- char *zWal = sqlite3_mprintf("%s-wal", pPager->zFilename);
- if( !zWal ){
- rc = SQLITE_NOMEM;
- }else{
- rc = sqlite3OsAccess(pPager->pVfs, zWal, SQLITE_ACCESS_EXISTS, pExists);
- sqlite3_free(zWal);
- }
+ assert( !pPager->tempFile );
+ zWal = sqlite3_mprintf("%s-wal", pPager->zFilename);
+ if( !zWal ){
+ rc = SQLITE_NOMEM;
}else{
- rc = SQLITE_OK;
- *pExists = 0;
+ rc = sqlite3OsAccess(pPager->pVfs, zWal, SQLITE_ACCESS_EXISTS, pExists);
+ sqlite3_free(zWal);
}
return rc;
}
@@ -2847,6 +2844,12 @@ int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
memset(pDest, 0, N);
assert( isOpen(pPager->fd) || pPager->tempFile );
+ /* This routine is only called by btree immediately after creating
+ ** the Pager object. There has not been an opportunity to transition
+ ** to WAL mode yet.
+ */
+ assert( !pagerUseWal(pPager) );
+#if 0
if( pagerUseWal(pPager) ){
int isInWal = 0;
rc = sqlite3WalRead(pPager->pWal, 1, &isInWal, N, pDest);
@@ -2854,6 +2857,7 @@ int sqlite3PagerReadFileheader(Pager *pPager, int N, unsigned char *pDest){
return rc;
}
}
+#endif
if( isOpen(pPager->fd) ){
IOTRACE(("DBHDR %p 0 %d\n", pPager, N))