SQLite4
Check-in [f9e75777b0]
Not logged in

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

Overview
Comment:Fix another free block list related bug.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | freelist-rework
Files: files | file ages | folders
SHA1: f9e75777b0fe2ab135c9398fec081561d0d3f866
User & Date: dan 2012-10-30 17:19:04
Context
2012-10-30
17:34
Avoid writing completely empty segments to the snapshot. check-in: 803f36b62f user: dan tags: freelist-rework
17:19
Fix another free block list related bug. check-in: f9e75777b0 user: dan tags: freelist-rework
16:27
Fix a couple of problems in the code that handles free block lists. check-in: 5c3e17cc90 user: dan tags: freelist-rework
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/lsm_file.c.

  1532   1532       }
  1533   1533   
  1534   1534       /* If this is the first page allocated, or if the page allocated is the
  1535   1535        ** last in the block, allocate a new block here.  */
  1536   1536       if( iApp==0 || fsIsLast(pFS, iApp) ){
  1537   1537         int iNew;                     /* New block number */
  1538   1538   
  1539         -      lsmBlockAllocate(pFS->pDb, &iNew);
         1539  +      rc = lsmBlockAllocate(pFS->pDb, &iNew);
         1540  +      if( rc!=LSM_OK ) return rc;
  1540   1541         if( iApp==0 ){
  1541   1542           iApp = fsFirstPageOnBlock(pFS, iNew);
  1542   1543         }else{
  1543   1544           iNext = fsFirstPageOnBlock(pFS, iNew);
  1544   1545         }
  1545   1546       }
  1546   1547   

Changes to src/lsm_shared.c.

   499    499   
   500    500     for(iCtx=0; iCtx<2; iCtx++){
   501    501       int i;
   502    502       WalkFreelistCtx *p = &ctx[iCtx];
   503    503       for(i=p->iFree; p->pFreelist && rc==LSM_OK && i<p->pFreelist->nEntry; i++){
   504    504         FreelistEntry *pEntry = &p->pFreelist->aEntry[i];
   505    505         if( pEntry->iId>=0 && p->xUsr(p->pUsrctx, pEntry->iBlk, pEntry->iId) ){
   506         -        return 1;
          506  +        return LSM_OK;
   507    507         }
   508    508       }
   509    509     }
   510    510   
   511    511     return rc;
   512    512   }
   513    513