/ Check-in [d5861d9f]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Remove a NEVER() from btree.c that could occur in a very obscure tested evaluation with an I/O error on fstat().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: d5861d9ffecca499d79d722b5f742ffe3a5aff44
User & Date: drh 2009-12-03 19:40:00
Context
2009-12-03
21:26
Fix an assert() in btree.c that might have fired on a corrupt database file. check-in: 5ab2b3e3 user: drh tags: trunk
19:40
Remove a NEVER() from btree.c that could occur in a very obscure tested evaluation with an I/O error on fstat(). check-in: d5861d9f user: drh tags: trunk
17:36
Fix an incorrect assert() in fts3.c. Add further fts3 tests. check-in: 75863c2d user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  2342   2342   static int newDatabase(BtShared *pBt){
  2343   2343     MemPage *pP1;
  2344   2344     unsigned char *data;
  2345   2345     int rc;
  2346   2346     int nPage;
  2347   2347   
  2348   2348     assert( sqlite3_mutex_held(pBt->mutex) );
  2349         -  /* The database size has already been measured and cached, so failure
  2350         -  ** is impossible here.  If the original size measurement failed, then
  2351         -  ** processing aborts before entering this routine. */
  2352   2349     rc = sqlite3PagerPagecount(pBt->pPager, &nPage);
  2353         -  if( NEVER(rc!=SQLITE_OK) || nPage>0 ){
         2350  +  if( rc!=SQLITE_OK || nPage>0 ){
  2354   2351       return rc;
  2355   2352     }
  2356   2353     pP1 = pBt->pPage1;
  2357   2354     assert( pP1!=0 );
  2358   2355     data = pP1->aData;
  2359   2356     rc = sqlite3PagerWrite(pP1->pDbPage);
  2360   2357     if( rc ) return rc;