aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordan <dan@noemail.net>2010-06-09 16:58:49 +0000
committerdan <dan@noemail.net>2010-06-09 16:58:49 +0000
commit199100e2cdd8cd54bbaacaaf5c2f7317f19587db (patch)
treefa58e1d74706e91d79e7d280a0c28823e0f389cb /src
parent6ac43394399ae3e19c60ca91719ada2fdc6af15b (diff)
downloadsqlite-199100e2cdd8cd54bbaacaaf5c2f7317f19587db.tar.gz
sqlite-199100e2cdd8cd54bbaacaaf5c2f7317f19587db.zip
When restarting (wrapping) a log file, set all unused aReadMark[] slots to READMARK_NOT_USED instead of 0. Setting them to 0 does not cause a problem, but may cause SQLite to obtain and release a few more file locks than would otherwise be necessary.
FossilOrigin-Name: 0797b10c0cc08ae38e26685d1f8331e37d428781
Diffstat (limited to 'src')
-rw-r--r--src/wal.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/wal.c b/src/wal.c
index 1b90d384f..017b84490 100644
--- a/src/wal.c
+++ b/src/wal.c
@@ -2217,13 +2217,16 @@ static int walRestartLog(Wal *pWal){
** safe and means there is no special case for sqlite3WalUndo()
** to handle if this transaction is rolled back.
*/
+ int i; /* Loop counter */
u32 *aSalt = pWal->hdr.aSalt; /* Big-endian salt values */
pWal->nCkpt++;
pWal->hdr.mxFrame = 0;
sqlite3Put4byte((u8*)&aSalt[0], 1 + sqlite3Get4byte((u8*)&aSalt[0]));
sqlite3_randomness(4, &aSalt[1]);
walIndexWriteHdr(pWal);
- memset((void*)pInfo, 0, sizeof(*pInfo));
+ pInfo->nBackfill = 0;
+ for(i=1; i<WAL_NREADER; i++) pInfo->aReadMark[i] = READMARK_NOT_USED;
+ assert( pInfo->aReadMark[0]==0 );
walUnlockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
}
}