SQLite4
Check-in [4d830d87e4]
Not logged in

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

Overview
Comment:When recycling an lsm cursor, reset the flags field.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | prefix-mmap
Files: files | file ages | folders
SHA1:4d830d87e42c7aab45add1327c5292a25d7a7e3d
User & Date: dan 2013-03-07 18:36:56
Context
2013-03-07
19:54
Fix a compressed database mode bug. check-in: 84e9aca245 user: dan tags: prefix-mmap
18:36
When recycling an lsm cursor, reset the flags field. check-in: 4d830d87e4 user: dan tags: prefix-mmap
2013-03-06
20:15
Allow accessing a prefix of the database file using mmap and the remainder using read and write. check-in: abe0420724 user: dan tags: prefix-mmap
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to lsm-test/lsmtest_tdb3.c.

   986    986   }
   987    987   
   988    988   int test_lsm_small_open(
   989    989     const char *zFile, 
   990    990     int bClear, 
   991    991     TestDb **ppDb
   992    992   ){
   993         -  const char *zCfg = "page_size=256 block_size=64";
          993  +  const char *zCfg = "page_size=256 block_size=64 mmap=1024";
   994    994     return testLsmOpen(zCfg, zFile, bClear, ppDb);
   995    995   }
   996    996   
   997    997   int test_lsm_lomem_open(
   998    998     const char *zFilename, 
   999    999     int bClear, 
  1000   1000     TestDb **ppDb

Changes to src/kvlsm.c.

   464    464       struct Config {
   465    465         const char *zParam;
   466    466         int eParam;
   467    467       } aConfig[] = {
   468    468         { "lsm_mmap", LSM_CONFIG_MMAP },
   469    469         { "lsm_page_size", LSM_CONFIG_PAGE_SIZE },
   470    470         { "lsm_block_size", LSM_CONFIG_BLOCK_SIZE },
   471         -      { "lsm_multiple_processes", LSM_CONFIG_MULTIPLE_PROCESSES }
          471  +      { "lsm_multiple_processes", LSM_CONFIG_MULTIPLE_PROCESSES },
          472  +      { "lsm_automerge", LSM_CONFIG_AUTOMERGE }
   472    473       };
   473    474   
   474    475       memset(pNew, 0, sizeof(KVLsm));
   475    476       pNew->base.pStoreVfunc = &kvlsmMethods;
   476    477       pNew->base.pEnv = pEnv;
   477    478       rc = lsm_new(0, &pNew->pDb);
   478    479       if( rc==SQLITE4_OK ){
   479    480         int i;
   480         -      int bMmap = 0;
   481         -      lsm_config(pNew->pDb, LSM_CONFIG_MMAP, &bMmap);
   482         -
   483    481         for(i=0; i<ArraySize(aConfig); i++){
   484    482           const char *zVal = sqlite4_uri_parameter(zName, aConfig[i].zParam);
   485    483           if( zVal ){
   486    484             int nVal = sqlite4Atoi(zVal);
   487    485             lsm_config(pNew->pDb, aConfig[i].eParam, &nVal);
   488    486           }
   489    487         }

Changes to src/lsm_file.c.

   333    333   
   334    334   #ifdef NDEBUG
   335    335   # define assert_lists_are_ok(x)
   336    336   #else
   337    337   static Page *fsPageFindInHash(FileSystem *pFS, Pgno iPg, int *piHash);
   338    338   
   339    339   static void assert_lists_are_ok(FileSystem *pFS){
          340  +#if 0
   340    341     Page *p;
   341    342   
   342    343     assert( pFS->nMapLimit>=0 );
   343    344   
   344    345     /* Check that all pages in the LRU list have nRef==0, pointers to buffers
   345    346     ** in heap memory, and corresponding entries in the hash table.  */
   346    347     for(p=pFS->pLruFirst; p; p=p->pLruNext){
................................................................................
   348    349       assert( p==pFS->pLruLast || p->pLruNext!=0 );
   349    350       assert( p->pLruPrev==0 || p->pLruPrev->pLruNext==p );
   350    351       assert( p->pLruNext==0 || p->pLruNext->pLruPrev==p );
   351    352       assert( p->nRef==0 );
   352    353       assert( p->flags & PAGE_FREE );
   353    354       assert( p==fsPageFindInHash(pFS, p->iPg, 0) );
   354    355     }
          356  +#endif
   355    357   }
   356    358   #endif
   357    359   
   358    360   /*
   359    361   ** Wrappers around the VFS methods of the lsm_env object:
   360    362   **
   361    363   **     lsmEnvOpen()

Changes to src/lsm_shared.c.

   508    508   
   509    509     /* If the db handle is read-write, then connect to the system now. Run
   510    510     ** recovery as necessary. Or, if this is a read-only database handle,
   511    511     ** defer attempting to connect to the system until a read-transaction
   512    512     ** is opened.  */
   513    513     if( pDb->bReadonly==0 ){
   514    514       if( rc==LSM_OK ){
   515         -      rc = doDbConnect(pDb);
          515  +      rc = lsmFsConfigure(pDb);
   516    516       }
   517    517       if( rc==LSM_OK ){
   518         -      rc = lsmFsConfigure(pDb);
          518  +      rc = doDbConnect(pDb);
   519    519       }
   520    520     }
   521    521   
   522    522     return rc;
   523    523   }
   524    524   
   525    525   static void dbDeferClose(lsm_db *pDb){

Changes to src/lsm_sorted.c.

  2488   2488       bOld = (lsmTreeHasOld(pDb) && pDb->treehdr.iOldLog!=pDb->pClient->iLogOff);
  2489   2489       if( !bOld && pCsr->apTreeCsr[1] ){
  2490   2490         lsmTreeCursorDestroy(pCsr->apTreeCsr[1]);
  2491   2491         pCsr->apTreeCsr[1] = 0;
  2492   2492       }else if( bOld && !pCsr->apTreeCsr[1] ){
  2493   2493         rc = lsmTreeCursorNew(pDb, 1, &pCsr->apTreeCsr[1]);
  2494   2494       }
         2495  +
         2496  +    pCsr->flags = (CURSOR_IGNORE_SYSTEM | CURSOR_IGNORE_DELETE);
  2495   2497   
  2496   2498     }else{
  2497   2499       pCsr = multiCursorNew(pDb, &rc);
  2498   2500       if( rc==LSM_OK ) rc = multiCursorInit(pCsr, pDb->pClient);
  2499   2501     }
  2500   2502   
  2501   2503     if( rc!=LSM_OK ){