/ Check-in [7abcd54e]
Login

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

Overview
Comment:Remove a condition that must always be true. Replace it with an assert().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7abcd54ec09e8025193d1e0ea57775051d823801
User & Date: drh 2010-06-10 01:07:42
Context
2010-06-10
06:53
Store the MemPage structure in memory following, instead of preceding, the page data for cached pages. This reduces the likelihood of a corrupt database page image causing SQLite to read past the end of a buffer. check-in: 0ce42e76 user: dan tags: trunk
01:07
Remove a condition that must always be true. Replace it with an assert(). check-in: 7abcd54e user: drh tags: trunk
2010-06-09
19:01
Fix test script problems causing errors in the "inmemory_journal" permutations. check-in: ea05b7f9 user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1434   1434     sqlite3BitvecDestroy(pPager->pInJournal);
  1435   1435     pPager->pInJournal = 0;
  1436   1436     pPager->nRec = 0;
  1437   1437     sqlite3PcacheCleanAll(pPager->pPCache);
  1438   1438   
  1439   1439     if( pagerUseWal(pPager) ){
  1440   1440       rc2 = sqlite3WalEndWriteTransaction(pPager->pWal);
         1441  +    assert( rc2==SQLITE_OK );
  1441   1442       pPager->state = PAGER_SHARED;
  1442   1443   
  1443   1444       /* If the connection was in locking_mode=exclusive mode but is no longer,
  1444   1445       ** drop the EXCLUSIVE lock held on the database file.
  1445   1446       */
  1446         -    if( rc2==SQLITE_OK 
  1447         -     && !pPager->exclusiveMode 
  1448         -     && sqlite3WalExclusiveMode(pPager->pWal, 0) 
  1449         -    ){
         1447  +    if( !pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, 0) ){
  1450   1448         rc2 = osUnlock(pPager->fd, SHARED_LOCK);
  1451   1449       }
  1452   1450     }else if( !pPager->exclusiveMode ){
  1453   1451       rc2 = osUnlock(pPager->fd, SHARED_LOCK);
  1454   1452       pPager->state = PAGER_SHARED;
  1455   1453       pPager->changeCountDone = 0;
  1456   1454     }else if( pPager->state==PAGER_SYNCED ){