/ Check-in [e5165c80]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix an issue with the previous check-in, (6929). (CVS 6930)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e5165c80abfdba0ad74e1042e4c94fe00d4b3308
User & Date: drh 2009-07-24 21:23:16
Context
2009-07-25
00:10
Remove an overzealous assert() from pager.c. (CVS 6931) check-in: 4a924b47 user: drh tags: trunk
2009-07-24
21:23
Fix an issue with the previous check-in, (6929). (CVS 6930) check-in: e5165c80 user: drh tags: trunk
19:01
Further simplifications to pager.c in support of structural coverage testing. (CVS 6929) check-in: 866216c0 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.616 2009/07/24 19:01:19 drh Exp $
           21  +** @(#) $Id: pager.c,v 1.617 2009/07/24 21:23:16 drh Exp $
    22     22   */
    23     23   #ifndef SQLITE_OMIT_DISKIO
    24     24   #include "sqliteInt.h"
    25     25   
    26     26   /*
    27     27   ** Macros for troubleshooting.  Normally turned off
    28     28   */
................................................................................
  3410   3410   */
  3411   3411   static int hasHotJournal(Pager *pPager, int *pExists){
  3412   3412     sqlite3_vfs * const pVfs = pPager->pVfs;
  3413   3413     int rc;                       /* Return code */
  3414   3414     int exists;                   /* True if a journal file is present */
  3415   3415   
  3416   3416     assert( pPager!=0 );
  3417         -  assert( useJournal );
         3417  +  assert( pPager->useJournal );
  3418   3418     assert( isOpen(pPager->fd) );
  3419   3419     assert( !isOpen(pPager->jfd) );
  3420   3420   
  3421   3421     *pExists = 0;
  3422   3422     rc = sqlite3OsAccess(pVfs, pPager->zJournal, SQLITE_ACCESS_EXISTS, &exists);
  3423   3423     if( rc==SQLITE_OK && exists ){
  3424   3424       int locked;                 /* True if some process holds a RESERVED lock */
................................................................................
  3508   3508     Pgno pgno = pPg->pgno;       /* Page number to read */
  3509   3509     int rc;                      /* Return code */
  3510   3510     i64 iOffset;                 /* Byte offset of file to read from */
  3511   3511   
  3512   3512     assert( pPager->state>=PAGER_SHARED && !MEMDB );
  3513   3513     assert( isOpen(pPager->fd) );
  3514   3514   
  3515         -  if( !isOpen(pPager->fd) ){
         3515  +  if( NEVER(!isOpen(pPager->fd)) ){
  3516   3516       assert( pPager->tempFile );
  3517   3517       memset(pPg->pData, 0, pPager->pageSize);
  3518   3518       return SQLITE_OK;
  3519   3519     }
  3520   3520     iOffset = (pgno-1)*(i64)pPager->pageSize;
  3521   3521     rc = sqlite3OsRead(pPager->fd, pPg->pData, pPager->pageSize, iOffset);
  3522   3522     if( rc==SQLITE_IOERR_SHORT_READ ){