1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-04 04:42:17 +03:00

Fix a problem with calculating the required size of the wal-index when appending frames.

FossilOrigin-Name: 9526b11130f3ed2f5227386a26263c767214603a
This commit is contained in:
dan
2010-04-30 16:50:00 +00:00
parent 400df2ea70
commit c9d53dbe5a
3 changed files with 10 additions and 20 deletions

View File

@@ -433,9 +433,9 @@ static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
u32 iSlot = walIndexEntry(iFrame);
walIndexMap(pWal, -1);
while( (iSlot+128)>=pWal->szWIndex ){
while( ((iSlot+128)*sizeof(u32))>=pWal->szWIndex ){
int rc;
int nByte = pWal->szWIndex*4 + WALINDEX_MMAP_INCREMENT;
int nByte = pWal->szWIndex + WALINDEX_MMAP_INCREMENT;
/* Enlarge the storage, then remap it. */
rc = walIndexRemap(pWal, nByte);