/ Check-in [9b79a390]
Login

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

Overview
Comment:Do not attempt to flush the pages of an in-memory database to disk if sqlite3_db_cacheflush() is called.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | cacheflush
Files: files | file ages | folders
SHA1: 9b79a390440a23542a370b591e567b31ebb35c42
User & Date: dan 2015-10-29 21:11:22
Context
2015-10-30
09:13
Test that calling sqlite3_db_cacheflush() does not interfere with savepoints. check-in: 0e09e4a2 user: dan tags: cacheflush
2015-10-29
21:11
Do not attempt to flush the pages of an in-memory database to disk if sqlite3_db_cacheflush() is called. check-in: 9b79a390 user: dan tags: cacheflush
20:57
Add a test case that calls sqlite3_db_cacheflush() on an in-memory database. check-in: f0cdfb54 user: dan tags: cacheflush
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  4474   4474   }
  4475   4475   
  4476   4476   /*
  4477   4477   ** Flush all unreferenced dirty pages to disk.
  4478   4478   */
  4479   4479   int sqlite3PagerFlush(Pager *pPager){
  4480   4480     int rc = pPager->errCode;
  4481         -  PgHdr *pList = sqlite3PcacheDirtyList(pPager->pPCache);
  4482         -
  4483         -  assert( assert_pager_state(pPager) );
  4484         -  while( rc==SQLITE_OK && pList ){
  4485         -    PgHdr *pNext = pList->pDirty;
  4486         -    if( pList->nRef==0 ){
  4487         -      rc = pagerStress((void*)pPager, pList);
         4481  +  if( !MEMDB ){
         4482  +    PgHdr *pList = sqlite3PcacheDirtyList(pPager->pPCache);
         4483  +    assert( assert_pager_state(pPager) );
         4484  +    while( rc==SQLITE_OK && pList ){
         4485  +      PgHdr *pNext = pList->pDirty;
         4486  +      if( pList->nRef==0 ){
         4487  +        rc = pagerStress((void*)pPager, pList);
         4488  +      }
         4489  +      pList = pNext;
  4488   4490       }
  4489         -    pList = pNext;
  4490   4491     }
  4491   4492   
  4492   4493     return rc;
  4493   4494   }
  4494   4495   
  4495   4496   /*
  4496   4497   ** Allocate and initialize a new Pager object and put a pointer to it