aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-06-05 19:18:59 +0000
committerdan <dan@noemail.net>2010-06-05 19:18:59 +0000
commit640aac48f3fdb77d57f35544d951147f09bddf18 (patch)
tree45a2a32353c67d6ad7fbdf74debe7852f3b8b2a7 /src
parenteb8cb3a851fb9a9d49f7e9687ac0583a9f4da157 (diff)
downloadsqlite-640aac48f3fdb77d57f35544d951147f09bddf18.tar.gz
sqlite-640aac48f3fdb77d57f35544d951147f09bddf18.zip
Add further test cases for the logic in sqlite3WalBeginReadTransaction().
FossilOrigin-Name: a49713db39d0d6940b368206d4e669aa69aa1fe5
Diffstat (limited to 'src')
-rw-r--r--src/wal.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/wal.c b/src/wal.c
index 45a2d75e7..22a0688ae 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -1747,7 +1747,7 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){
rc = walLockShared(pWal, WAL_READ_LOCK(0));
sqlite3OsShmBarrier(pWal->pDbFd);
if( rc==SQLITE_OK ){
- if( memcmp(pHdr, &pWal->hdr, sizeof(WalIndexHdr)) ){
+ if( memcmp((void *)pHdr, &pWal->hdr, sizeof(WalIndexHdr)) ){
/* It is not safe to allow the reader to continue here if frames
** may have been appended to the log before READ_LOCK(0) was obtained.
** When holding READ_LOCK(0), the reader ignores the entire log file,
@@ -1832,15 +1832,15 @@ static int walTryBeginRead(Wal *pWal, int *pChanged, int useWal, int cnt){
** pWal->hdr.mxFrame risks reading a corrupted snapshot. So, retry
** instead.
**
- ** This does not guarantee that the copy wal-index header is up to
- ** date before proceeding. This would not be possible without somehow
- ** blocking writers. It only guarantees that a damaging checkpoint or
+ ** This does not guarantee that the copy of the wal-index header is up to
+ ** date before proceeding. That would not be possible without somehow
+ ** blocking writers. It only guarantees that a dangerous checkpoint or
** log-wrap (either of which would require an exclusive lock on
** WAL_READ_LOCK(mxI)) has not occurred since the snapshot was valid.
*/
sqlite3OsShmBarrier(pWal->pDbFd);
if( pInfo->aReadMark[mxI]!=mxReadMark
- || memcmp(pHdr, &pWal->hdr, sizeof(WalIndexHdr))
+ || memcmp((void *)pHdr, &pWal->hdr, sizeof(WalIndexHdr))
){
walUnlockShared(pWal, WAL_READ_LOCK(mxI));
return WAL_RETRY;