/ Check-in [70501e4e]
Login

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

Overview
Comment:Report the error SQLITE_CORRUPT instead of SQLITE_IOERR if unable to rollback a hot journal that was damaged (for example) by filesystem corruption following a power failure. (CVS 3460)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 70501e4ea588ed762e4f6bc211ce63397faa3367
User & Date: drh 2006-10-03 19:05:19
Context
2006-10-03
19:12
Modify the makefile(s) to know about the FTS1 module - however FTS1 is turned off by default. Bump the version number to 3.3.8. (CVS 3461) check-in: 288ff637 user: drh tags: trunk
19:05
Report the error SQLITE_CORRUPT instead of SQLITE_IOERR if unable to rollback a hot journal that was damaged (for example) by filesystem corruption following a power failure. (CVS 3460) check-in: 70501e4e user: drh tags: trunk
17:40
Add the OS-X locking style patches to os_unix.c. Disabled by default. (CVS 3459) check-in: f4103dea 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
....
1337
1338
1339
1340
1341
1342
1343




1344
1345
1346
1347
1348
1349
1350
** 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.273 2006/09/15 12:29:16 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include "os.h"
#include "pager.h"
#include <assert.h>
#include <string.h>
................................................................................
      rc = pager_playback_one_page(pPager, pPager->jfd, 1);
      if( rc!=SQLITE_OK ){
        if( rc==SQLITE_DONE ){
          rc = SQLITE_OK;
          pPager->journalOff = szJ;
          break;
        }else{




          goto end_playback;
        }
      }
    }
  }
  /*NOTREACHED*/
  assert( 0 );







|







 







>
>
>
>







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
....
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
** 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.274 2006/10/03 19:05:19 drh Exp $
*/
#ifndef SQLITE_OMIT_DISKIO
#include "sqliteInt.h"
#include "os.h"
#include "pager.h"
#include <assert.h>
#include <string.h>
................................................................................
      rc = pager_playback_one_page(pPager, pPager->jfd, 1);
      if( rc!=SQLITE_OK ){
        if( rc==SQLITE_DONE ){
          rc = SQLITE_OK;
          pPager->journalOff = szJ;
          break;
        }else{
          /* If we are unable to rollback a hot journal, then the database
          ** is probably not recoverable.  Return CORRUPT.
          */
          rc = SQLITE_CORRUPT;
          goto end_playback;
        }
      }
    }
  }
  /*NOTREACHED*/
  assert( 0 );