/ Check-in [9526b111]
Login

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

Overview
Comment:Fix a problem with calculating the required size of the wal-index when appending frames.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | wal
Files: files | file ages | folders
SHA1: 9526b11130f3ed2f5227386a26263c767214603a
User & Date: dan 2010-04-30 16:50:00
Context
2010-04-30
17:05
Fix a problem with resizing the wal-index mapping after the mapping has been extended by an external process. check-in: 79d356fe user: dan tags: wal
16:50
Fix a problem with calculating the required size of the wal-index when appending frames. check-in: 9526b111 user: dan tags: wal
16:48
In the debugging output for SHM-LOCK in os_unix.c, use symbolic names for the lock states rather than raw numbers. check-in: 2afc33de user: drh tags: wal
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/wal.c.

429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
** the previous call), but that restriction is not enforced or asserted
** here.
*/
static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
  u32 iSlot = walIndexEntry(iFrame);
  
  walIndexMap(pWal, -1);
  while( (iSlot+128)>=pWal->szWIndex ){
    int rc;
    int nByte = pWal->szWIndex*4 + WALINDEX_MMAP_INCREMENT;

    /* Enlarge the storage, then remap it. */
    rc = walIndexRemap(pWal, nByte);
    if( rc!=SQLITE_OK ){
      return rc;
    }
  }







|

|







429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
** the previous call), but that restriction is not enforced or asserted
** here.
*/
static int walIndexAppend(Wal *pWal, u32 iFrame, u32 iPage){
  u32 iSlot = walIndexEntry(iFrame);
  
  walIndexMap(pWal, -1);
  while( ((iSlot+128)*sizeof(u32))>=pWal->szWIndex ){
    int rc;
    int nByte = pWal->szWIndex + WALINDEX_MMAP_INCREMENT;

    /* Enlarge the storage, then remap it. */
    rc = walIndexRemap(pWal, nByte);
    if( rc!=SQLITE_OK ){
      return rc;
    }
  }