/ Check-in [e83d3a2a]
Login

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

Overview
Comment:Improved testability.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal-overwrite-frames
Files: files | file ages | folders
SHA1: e83d3a2a4e06665e8a056f63063bd6df03f063b9
User & Date: drh 2016-01-11 00:52:32
Context
2016-01-11
08:12
Add a test case to waloverwrite.test to check that savepoint rollback does not cause a problem. Closed-Leaf check-in: 87dae56c user: dan tags: wal-overwrite-frames
00:52
Improved testability. check-in: e83d3a2a user: drh tags: wal-overwrite-frames
2016-01-09
23:55
All WAL frame overwrites even if there are active savepoints. This is safe because a ROLLBACK TO will cause all reverted pages to be rewritten to the WAL file prior to COMMIT. check-in: 99b31a6b user: drh tags: wal-overwrite-frames
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wal.c.

  3052   3052   
  3053   3053       /* Check if this page has already been written into the wal file by
  3054   3054       ** the current transaction. If so, overwrite the existing frame and
  3055   3055       ** set Wal.writeLock to WAL_WRITELOCK_RECKSUM - indicating that 
  3056   3056       ** checksums must be recomputed when the transaction is committed.  */
  3057   3057       if( iFirst && (p->pDirty || isCommit==0) ){
  3058   3058         u32 iWrite = 0;
  3059         -      rc = sqlite3WalFindFrame(pWal, p->pgno, &iWrite);
  3060         -      if( rc ) return rc;
         3059  +      VVA_ONLY(rc =) sqlite3WalFindFrame(pWal, p->pgno, &iWrite);
         3060  +      assert( rc==SQLITE_OK || iWrite==0 );
  3061   3061         if( iWrite>=iFirst ){
  3062   3062           i64 iOff = walFrameOffset(iWrite, szPage) + WAL_FRAME_HDRSIZE;
  3063   3063           if( pWal->iReCksum==0 || iWrite<pWal->iReCksum ){
  3064   3064             pWal->iReCksum = iWrite;
  3065   3065           }
  3066   3066           rc = sqlite3OsWrite(pWal->pWalFd, p->pData, szPage, iOff);
  3067   3067           if( rc ) return rc;