SQLite

Check-in [7abcd54ec0]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 7abcd54ec09e8025193d1e0ea57775051d823801
User & Date: drh 2010-06-10 01:07:42.000
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: 0ce42e7665 user: dan tags: trunk)
01:07
Remove a condition that must always be true. Replace it with an assert(). (check-in: 7abcd54ec0 user: drh tags: trunk)
2010-06-09
19:01
Fix test script problems causing errors in the "inmemory_journal" permutations. (check-in: ea05b7f929 user: dan tags: trunk)
Changes
Side-by-Side Diff Ignore Whitespace Patch
Changes to src/pager.c.
1434
1435
1436
1437
1438
1439
1440

1441
1442
1443
1444
1445
1446
1447
1448

1449
1450
1451
1452
1453
1454
1455
1456
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446



1447

1448
1449
1450
1451
1452
1453
1454







+





-
-
-
+
-







  sqlite3BitvecDestroy(pPager->pInJournal);
  pPager->pInJournal = 0;
  pPager->nRec = 0;
  sqlite3PcacheCleanAll(pPager->pPCache);

  if( pagerUseWal(pPager) ){
    rc2 = sqlite3WalEndWriteTransaction(pPager->pWal);
    assert( rc2==SQLITE_OK );
    pPager->state = PAGER_SHARED;

    /* If the connection was in locking_mode=exclusive mode but is no longer,
    ** drop the EXCLUSIVE lock held on the database file.
    */
    if( rc2==SQLITE_OK 
     && !pPager->exclusiveMode 
     && sqlite3WalExclusiveMode(pPager->pWal, 0) 
    if( !pPager->exclusiveMode && sqlite3WalExclusiveMode(pPager->pWal, 0) ){
    ){
      rc2 = osUnlock(pPager->fd, SHARED_LOCK);
    }
  }else if( !pPager->exclusiveMode ){
    rc2 = osUnlock(pPager->fd, SHARED_LOCK);
    pPager->state = PAGER_SHARED;
    pPager->changeCountDone = 0;
  }else if( pPager->state==PAGER_SYNCED ){