1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Amplification of a comment in wal.c. Change the aReadMark[] processing so

that one read mark is left at zero when a WAL resets.

FossilOrigin-Name: 8c9ee1d78f99394eef73a177141ca9e1c67e4e07
This commit is contained in:
drh
2012-07-17 02:56:05 +00:00
parent 206d0b6164
commit 610b8d8578
3 changed files with 12 additions and 10 deletions

View File

@@ -142,8 +142,9 @@
** byte order of the host computer.
**
** The purpose of the wal-index is to answer this question quickly: Given
** a page number P, return the index of the last frame for page P in the WAL,
** or return NULL if there are no frames for page P in the WAL.
** a page number P and a maximum frame index M, return the index of the
** last frame in the wal before frame M for page P in the WAL, or return
** NULL if there are no frames for page P in the WAL prior to M.
**
** The wal-index consists of a header region, followed by an one or
** more index blocks.
@@ -2611,7 +2612,8 @@ static int walRestartLog(Wal *pWal){
aSalt[1] = salt1;
walIndexWriteHdr(pWal);
pInfo->nBackfill = 0;
for(i=1; i<WAL_NREADER; i++) pInfo->aReadMark[i] = READMARK_NOT_USED;
pInfo->aReadMark[1] = 0;
for(i=2; i<WAL_NREADER; i++) pInfo->aReadMark[i] = READMARK_NOT_USED;
assert( pInfo->aReadMark[0]==0 );
walUnlockExclusive(pWal, WAL_READ_LOCK(1), WAL_NREADER-1);
}else if( rc!=SQLITE_BUSY ){