SQLite4
Check-in [bfa27bab8a]
Not logged in

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

Overview
Comment:Fix other problems revealed by src4.test.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | multi-process
Files: files | file ages | folders
SHA1: bfa27bab8af4826db95184bea5b20ee1d8370e6a
User & Date: dan 2012-08-25 20:05:06
Context
2012-08-25
20:24
Fix a memory leak in lsm_tree.c. check-in: 11ac1783f7 user: dan tags: multi-process
20:05
Fix other problems revealed by src4.test. check-in: bfa27bab8a user: dan tags: multi-process
19:17
Fix another bug to do with large key-value pairs. check-in: 511a91e121 user: dan tags: multi-process
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/lsm_main.c.

292
293
294
295
296
297
298








299


300
301
302
303
304
305
306
  if( rc==LSM_OK ) bOvfl = lsmCheckpointOverflow(pDb, &nLsmLevel);
  if( rc==LSM_OK ) rc = lsmSortedFlushTree(pDb, nLsmLevel, bOvfl);
  if( rc==LSM_OK ) lsmTreeClear(pDb);

  lsmFinishWork(pDb, 1, &rc);

  /* Restore the position of any open cursors */








  if( rc==LSM_OK ) rc = lsmRestoreCursors(pDb);



#if 0
  if( rc==LSM_OK ) lsmSortedDumpStructure(pDb, pDb->pWorker, 0, 0, "flush");
#endif

  return rc;
}







>
>
>
>
>
>
>
>
|
>
>







292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
  if( rc==LSM_OK ) bOvfl = lsmCheckpointOverflow(pDb, &nLsmLevel);
  if( rc==LSM_OK ) rc = lsmSortedFlushTree(pDb, nLsmLevel, bOvfl);
  if( rc==LSM_OK ) lsmTreeClear(pDb);

  lsmFinishWork(pDb, 1, &rc);

  /* Restore the position of any open cursors */
  if( rc==LSM_OK && pDb->pCsr ){
    lsmFreeSnapshot(pDb->pEnv, pDb->pClient);
    pDb->pClient = 0;
    rc = lsmCheckpointLoad(pDb);
    if( rc==LSM_OK ){
      rc = lsmCheckpointDeserialize(pDb, pDb->aSnapshot, &pDb->pClient);
    }
    if( rc==LSM_OK ){
      rc = lsmRestoreCursors(pDb);
    }
  }

#if 0
  if( rc==LSM_OK ) lsmSortedDumpStructure(pDb, pDb->pWorker, 0, 0, "flush");
#endif

  return rc;
}

Changes to src/lsm_sorted.c.

4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075

  /* If the FLUSH flag is set, try to flush the contents of the in-memory
  ** tree to disk.  */
  if( (flags & LSM_WORK_FLUSH) ){
    rc = lsmBeginWriteTrans(pDb);
    if( rc==LSM_OK ){
      rc = lsmFlushToDisk(pDb);
      lsmFinishWriteTrans(pDb, 0);
      lsmFinishReadTrans(pDb);
    }
  }

  if( rc==LSM_OK && nPage>0 ){
    int bOptimize = ((flags & LSM_WORK_OPTIMIZE) ? 1 : 0);
    int nWrite = 0;







|







4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075

  /* If the FLUSH flag is set, try to flush the contents of the in-memory
  ** tree to disk.  */
  if( (flags & LSM_WORK_FLUSH) ){
    rc = lsmBeginWriteTrans(pDb);
    if( rc==LSM_OK ){
      rc = lsmFlushToDisk(pDb);
      lsmFinishWriteTrans(pDb, 1);
      lsmFinishReadTrans(pDb);
    }
  }

  if( rc==LSM_OK && nPage>0 ){
    int bOptimize = ((flags & LSM_WORK_OPTIMIZE) ? 1 : 0);
    int nWrite = 0;