/ Check-in [1f44a9bd]
Login

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

Overview
Comment:Make sure all bytes of the WAL file are initialized even if the checksums are not being computed until commit due to WAL overwrite.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:1f44a9bdc1577aed088d9b91882527228015dcd3
User & Date: drh 2016-01-12 02:28:19
Context
2016-01-12
04:08
Remove an unused field from the MemPage object. check-in: 5fc0a4c1 user: drh tags: trunk
02:28
Make sure all bytes of the WAL file are initialized even if the checksums are not being computed until commit due to WAL overwrite. check-in: 1f44a9bd user: drh tags: trunk
02:00
Fix an uninitialized field in the Select object when SELECTTRACE is enabled. check-in: fc628516 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Show Whitespace Changes Patch

Changes to src/wal.c.

704
705
706
707
708
709
710


711
712
713
714
715
716
717

    nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
    walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);
    walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);

    sqlite3Put4byte(&aFrame[16], aCksum[0]);
    sqlite3Put4byte(&aFrame[20], aCksum[1]);


  }
}

/*
** Check to see if the frame with header in aFrame[] and content
** in aData[] is valid.  If it is a valid frame, fill *piPage and
** *pnTruncate and return true.  Return if the frame is not valid.







>
>







704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719

    nativeCksum = (pWal->hdr.bigEndCksum==SQLITE_BIGENDIAN);
    walChecksumBytes(nativeCksum, aFrame, 8, aCksum, aCksum);
    walChecksumBytes(nativeCksum, aData, pWal->szPage, aCksum, aCksum);

    sqlite3Put4byte(&aFrame[16], aCksum[0]);
    sqlite3Put4byte(&aFrame[20], aCksum[1]);
  }else{
    memset(&aFrame[8], 0, 16);
  }
}

/*
** Check to see if the frame with header in aFrame[] and content
** in aData[] is valid.  If it is a valid frame, fill *piPage and
** *pnTruncate and return true.  Return if the frame is not valid.