SQLite

Check-in [7ac713a14e]
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
Timelines: family | ancestors | descendants | both | statvfs
Files: files | file ages | folders
SHA1: 7ac713a14e24c48651c2a97acc9839850fa7f3c3
User & Date: drh 2011-12-20 22:18:51.258
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: c83627b732 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: 7ac713a14e 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: 92c73b421b user: drh tags: statvfs)
Changes
Unified Diff Show Whitespace Changes Patch
Changes to src/wal.c.
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
      u32 pgno;                   /* Database page number for frame */
      u32 nTruncate;              /* dbsize field from frame header */

      /* Read and decode the next log frame. */
      iFrame++;
      rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset);
      if( rc!=SQLITE_OK ) break;
      if( sqlite3Get4byte(&aFrame[8]) ==
            1+sqlite3Get4byte((u8*)&pWal->hdr.aSalt[0]) ){
        pWal->hdr.mxFrame = 0;
        pWal->hdr.nPage = 0;
        break;
      }
      if( !isValid ) continue;
      isValid = walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame);
      if( !isValid ) continue;
      rc = walIndexAppend(pWal, iFrame, pgno);
      if( rc!=SQLITE_OK ) break;

      /* If nTruncate is non-zero, this is a commit record. */
      if( nTruncate ){
        pWal->hdr.mxFrame = iFrame;
        pWal->hdr.nPage = nTruncate;







<
<
<
<
<
<
<

|







1159
1160
1161
1162
1163
1164
1165







1166
1167
1168
1169
1170
1171
1172
1173
1174
      u32 pgno;                   /* Database page number for frame */
      u32 nTruncate;              /* dbsize field from frame header */

      /* Read and decode the next log frame. */
      iFrame++;
      rc = sqlite3OsRead(pWal->pWalFd, aFrame, szFrame, iOffset);
      if( rc!=SQLITE_OK ) break;







      isValid = walDecodeFrame(pWal, &pgno, &nTruncate, aData, aFrame);
      if( !isValid ) break;
      rc = walIndexAppend(pWal, iFrame, pgno);
      if( rc!=SQLITE_OK ) break;

      /* If nTruncate is non-zero, this is a commit record. */
      if( nTruncate ){
        pWal->hdr.mxFrame = iFrame;
        pWal->hdr.nPage = nTruncate;