SQLite

Check-in [4b46805cbc]
Login

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

Overview
Comment:When recovering from the error-state in pagerSharedLock(), do not search for a hot-journal in the file-system if the pager is configured to use an anonymous temp file as the journal. (CVS 6793)
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 4b46805cbc9fe71f1febe9ea5f0f5634b65128e3
User & Date: danielk1977 2009-06-20 18:52:50.000
Context
2009-06-22
00:55
Simplifications to vdbe.c in support of coverage testing. (CVS 6794) (check-in: 16680f05bd user: drh tags: trunk)
2009-06-20
18:52
When recovering from the error-state in pagerSharedLock(), do not search for a hot-journal in the file-system if the pager is configured to use an anonymous temp file as the journal. (CVS 6793) (check-in: 4b46805cbc user: danielk1977 tags: trunk)
11:54
If after obtaining an exclusive lock to rollback a hot-journal file it is found that the journal file has been deleted, do not return an SQLITE_BUSY error. Just downgrade the lock and continue with the current operation. This eliminates a spurious SQLITE_BUSY error caused by a race condition. (CVS 6792) (check-in: 9a06660037 user: danielk1977 tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** 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.599 2009/06/20 11:54:39 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/







|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** 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.600 2009/06/20 18:52:50 danielk1977 Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"

/*
** Macros for troubleshooting.  Normally turned off
*/
3573
3574
3575
3576
3577
3578
3579

3580

3581
3582
3583
3584
3585
3586
3587

  /* If this database has no outstanding page references and is in an 
  ** error-state, this is a chance to clear the error. Discard the 
  ** contents of the pager-cache and rollback any hot journal in the
  ** file-system.
  */
  if( !MEMDB && sqlite3PcacheRefCount(pPager->pPCache)==0 && pPager->errCode ){

    isErrorReset = 1;

    pPager->errCode = SQLITE_OK;
    pager_reset(pPager);
  }

  /* If the pager is still in an error state, do not proceed. The error 
  ** state will be cleared at some point in the future when all page 
  ** references are dropped and the cache can be discarded.







>
|
>







3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589

  /* If this database has no outstanding page references and is in an 
  ** error-state, this is a chance to clear the error. Discard the 
  ** contents of the pager-cache and rollback any hot journal in the
  ** file-system.
  */
  if( !MEMDB && sqlite3PcacheRefCount(pPager->pPCache)==0 && pPager->errCode ){
    if( isOpen(pPager->jfd) || pPager->zJournal ){
      isErrorReset = 1;
    }
    pPager->errCode = SQLITE_OK;
    pager_reset(pPager);
  }

  /* If the pager is still in an error state, do not proceed. The error 
  ** state will be cleared at some point in the future when all page 
  ** references are dropped and the cache can be discarded.