/ Check-in [7ac713a1]
Login

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

Overview
Comment:Remove the code that tries to detect OOO header writes on a WAL recovery. The code is made obsolete by syncing the WAL header.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | statvfs
Files: files | file ages | folders
SHA1: 7ac713a14e24c48651c2a97acc9839850fa7f3c3
User & Date: drh 2011-12-20 22:18:51
Context
2011-12-21
14:42
Add the ability to enable or disable SQLITE_IOCAP_ZERO_DAMAGE using a URI parameter for both unix and windows. Add a file-control to query or disable the ZERO_DAMAGE setting. Add the -uri option to the "sqlite3" TCL command in tclsqlite3.c. Allow the sqlite3_uri_parameter() interface to accept a NULL pointer for its first parameter. check-in: c83627b7 user: drh tags: statvfs
2011-12-20
22:18
Remove the code that tries to detect OOO header writes on a WAL recovery. The code is made obsolete by syncing the WAL header. check-in: 7ac713a1 user: drh tags: statvfs
20:13
Refactor the sqlite3WalFrames() routine for clarity of presentation. Do the padded transaction sync as the write pointer crosses the final sector boundary instead of at the end, for efficiency. Always sync the WAL header immediately after it is written. check-in: 92c73b42 user: drh tags: statvfs
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/wal.c.

  1159   1159         u32 pgno;                   /* Database page number for frame */
  1160   1160         u32 nTruncate;              /* dbsize field from frame header */
  1161   1161   
  1162   1162         /* Read and decode the next log frame. */
  1163   1163         iFrame++;
  1164   1164         rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset);
  1165   1165         if( rc!=SQLITE_OK ) break;
  1166         -      if( sqlite3Get4byte(&aFrame[8]) ==
  1167         -            1+sqlite3Get4byte((u8*)&pWal->hdr.aSalt[0]) ){
  1168         -        pWal->hdr.mxFrame = 0;
  1169         -        pWal->hdr.nPage = 0;
  1170         -        break;
  1171         -      }
  1172         -      if( !isValid ) continue;
  1173   1166         isValid = walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame);
  1174         -      if( !isValid ) continue;
         1167  +      if( !isValid ) break;
  1175   1168         rc = walIndexAppend(pWal, iFrame, pgno);
  1176   1169         if( rc!=SQLITE_OK ) break;
  1177   1170   
  1178   1171         /* If nTruncate is non-zero, this is a commit record. */
  1179   1172         if( nTruncate ){
  1180   1173           pWal->hdr.mxFrame = iFrame;
  1181   1174           pWal->hdr.nPage = nTruncate;