Index: src/pager.c ================================================================== --- src/pager.c +++ src/pager.c @@ -16,11 +16,11 @@ ** is separate from the database file. The pager also implements file ** locking to prevent two processes from writing the same database ** file simultaneously, or one process from reading the database while ** another is writing. ** -** @(#) $Id: pager.c,v 1.616 2009/07/24 19:01:19 drh Exp $ +** @(#) $Id: pager.c,v 1.617 2009/07/24 21:23:16 drh Exp $ */ #ifndef SQLITE_OMIT_DISKIO #include "sqliteInt.h" /* @@ -3412,11 +3412,11 @@ sqlite3_vfs * const pVfs = pPager->pVfs; int rc; /* Return code */ int exists; /* True if a journal file is present */ assert( pPager!=0 ); - assert( useJournal ); + assert( pPager->useJournal ); assert( isOpen(pPager->fd) ); assert( !isOpen(pPager->jfd) ); *pExists = 0; rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists); @@ -3510,11 +3510,11 @@ i64 iOffset; /* Byte offset of file to read from */ assert( pPager->state>=PAGER_SHARED && !MEMDB ); assert( isOpen(pPager->fd) ); - if( !isOpen(pPager->fd) ){ + if( NEVER(!isOpen(pPager->fd)) ){ assert( pPager->tempFile ); memset(pPg->pData, 0, pPager->pageSize); return SQLITE_OK; } iOffset = (pgno-1)*(i64)pPager->pageSize;