SQLite4
Check-in [549868a020]
Not logged in

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

Overview
Comment:Fix bug reading page data from a compressed database that occurs when the last page of a segment ends on the last byte of a block.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | compression-hooks
Files: files | file ages | folders
SHA1: 549868a020c84d239bc87c61177c475fc75368f7
User & Date: dan 2012-10-25 11:08:57
Context
2012-10-26
16:42
Store page numbers in database snapshots as 64-bit integers. check-in: 53de55a6f4 user: dan tags: compression-hooks
2012-10-25
11:08
Fix bug reading page data from a compressed database that occurs when the last page of a segment ends on the last byte of a block. check-in: 549868a020 user: dan tags: compression-hooks
2012-10-24
19:54
Have lsmtest use zlib for compression if HAVE_ZLIB is defined. This causes at least one test to fail. check-in: 8670182769 user: dan tags: compression-hooks
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/lsm_file.c.

1298
1299
1300
1301
1302
1303
1304
1305
1306
1307


1308
1309
1310
1311
1312
1313
1314

static int fsNextPageOffset(Segment *pSeg, Page *pPg, Pgno *piNext){
  Pgno iNext;
  int rc;

  assert( pPg->pFS->pCompress );

  rc = fsAddOffset(pPg->pFS, pPg->iPg, 2*3 + pPg->nCompress, &iNext);
  if( pSeg && pSeg->iLastPg==(iNext-1) ){
    iNext = 0;


  }

  *piNext = iNext;
  return rc;
}

static int fsGetPageBefore(FileSystem *pFS, i64 iOff, Pgno *piPrev){







|
|

>
>







1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316

static int fsNextPageOffset(Segment *pSeg, Page *pPg, Pgno *piNext){
  Pgno iNext;
  int rc;

  assert( pPg->pFS->pCompress );

  rc = fsAddOffset(pPg->pFS, pPg->iPg, 2*3 + pPg->nCompress - 1, &iNext);
  if( pSeg && iNext==pSeg->iLastPg ){
    iNext = 0;
  }else if( rc==LSM_OK ){
    rc = fsAddOffset(pPg->pFS, iNext, 1, &iNext);
  }

  *piNext = iNext;
  return rc;
}

static int fsGetPageBefore(FileSystem *pFS, i64 iOff, Pgno *piPrev){