/ Check-in [f5fad52a]
Login

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

Overview
Comment:Remove asserts on the existing of journal files in pager - asserts that are not valid for certain kinds of simulated I/O errors or for async I/O. (CVS 3769)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:f5fad52a97a16faddc2701ea0e05a301974eda1a
User & Date: drh 2007-03-30 17:18:51
Context
2007-03-30
18:21
Coverage testing for a few lines in pager.c. (CVS 3770) check-in: c1aca18f user: danielk1977 tags: trunk
17:18
Remove asserts on the existing of journal files in pager - asserts that are not valid for certain kinds of simulated I/O errors or for async I/O. (CVS 3769) check-in: f5fad52a user: drh tags: trunk
17:17
Get the memleak.test script working again after recent changes. (CVS 3768) check-in: cd6ca078 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/pager.c.

14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...
952
953
954
955
956
957
958



959
960
961
962
963
964
965
966
967
968
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** 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.309 2007/03/30 16:01:55 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include "os.h"
#include "pager.h"
#include <assert.h>
#include <string.h>
................................................................................
      sqlite3OsClose(&pPager->jfd);
      pPager->journalOpen = 0;
      /* If this is a temporary pager file, then the journal file should
      ** have been configured as delete-on-close. Otherwise, it should still
      ** be in the file system. This pager still holds a RESERVED or greater
      ** lock on the database file, so there is no chance another process
      ** could create or remove a journal file.



      */
      assert( sqlite3OsFileExists(pPager->zJournal) || pPager->tempFile );
      assert( !sqlite3OsFileExists(pPager->zJournal) || !pPager->tempFile );
      if( !pPager->tempFile ){
        rc = sqlite3OsDelete(pPager->zJournal);
      }
    }
    sqliteFree( pPager->aInJournal );
    pPager->aInJournal = 0;
    for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){







|







 







>
>
>

|
|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
...
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** 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.310 2007/03/30 17:18:51 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include "os.h"
#include "pager.h"
#include <assert.h>
#include <string.h>
................................................................................
      sqlite3OsClose(&pPager->jfd);
      pPager->journalOpen = 0;
      /* If this is a temporary pager file, then the journal file should
      ** have been configured as delete-on-close. Otherwise, it should still
      ** be in the file system. This pager still holds a RESERVED or greater
      ** lock on the database file, so there is no chance another process
      ** could create or remove a journal file.
      **
      ** These asserts are not valid for asynchronous I/O such as is found
      ** in async.test
      */
      /*assert( sqlite3OsFileExists(pPager->zJournal) || pPager->tempFile );*/
      /*assert( !sqlite3OsFileExists(pPager->zJournal) || !pPager->tempFile );*/
      if( !pPager->tempFile ){
        rc = sqlite3OsDelete(pPager->zJournal);
      }
    }
    sqliteFree( pPager->aInJournal );
    pPager->aInJournal = 0;
    for(pPg=pPager->pAll; pPg; pPg=pPg->pNextAll){