/ Check-in [fb26ae72]
Login

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

Overview
Comment:Avoid doing IO purely to check assert() constraints. (CVS 5526)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: fb26ae723959390a716f221af93c6c29eec16955
User & Date: danielk1977 2008-08-02 17:03:32
Context
2008-08-02
17:36
Fix a reference count leak introduced by (5526). (CVS 5527) check-in: f653995c user: danielk1977 tags: trunk
17:03
Avoid doing IO purely to check assert() constraints. (CVS 5526) check-in: fb26ae72 user: danielk1977 tags: trunk
15:32
Fix a bug introduced by (5519) causing builds with SQLITE_OMIT_VIRTUALTABLE to malfunction. (CVS 5525) check-in: 761e73ce user: danielk1977 tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

     5      5   ** a legal notice, here is a blessing:
     6      6   **
     7      7   **    May you do good and not evil.
     8      8   **    May you find forgiveness for yourself and forgive others.
     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12         -** $Id: btree.c,v 1.493 2008/08/01 20:10:08 drh Exp $
           12  +** $Id: btree.c,v 1.494 2008/08/02 17:03:32 danielk1977 Exp $
    13     13   **
    14     14   ** This file implements a external (disk-based) database using BTrees.
    15     15   ** See the header comment on "btreeInt.h" for additional information.
    16     16   ** Including a description of file format and an overview of operation.
    17     17   */
    18     18   #include "btreeInt.h"
    19     19   
................................................................................
  4519   4519         nSrc = nData;
  4520   4520         pSrc = pData;
  4521   4521       }
  4522   4522     }
  4523   4523     releasePage(pToRelease);
  4524   4524     return SQLITE_OK;
  4525   4525   }
         4526  +
  4526   4527   
  4527   4528   /*
  4528   4529   ** Change the MemPage.pParent pointer on the page whose number is
  4529   4530   ** given in the second argument so that MemPage.pParent holds the
  4530   4531   ** pointer in the third argument.
  4531   4532   **
  4532   4533   ** If the final argument, updatePtrmap, is non-zero and the database
................................................................................
  4566   4567       return ptrmapPut(pBt, pgno, PTRMAP_BTREE, pNewParent->pgno);
  4567   4568     }
  4568   4569   
  4569   4570   #ifndef NDEBUG
  4570   4571     /* If the updatePtrmap flag was clear, assert that the entry in the
  4571   4572     ** pointer-map is already correct.
  4572   4573     */
  4573         -  if( ISAUTOVACUUM ){
         4574  +  if( ISAUTOVACUUM && sqlite3PagerLookup(pBt->pPager,PTRMAP_PAGENO(pBt,pgno)) ){
  4574   4575       u8 eType;
  4575   4576       Pgno ii;
  4576         -    ptrmapGet(pBt, pgno, &eType, &ii);
  4577         -    assert( ii==pNewParent->pgno && eType==PTRMAP_BTREE );
         4577  +    int rc;
         4578  +    rc = ptrmapGet(pBt, pgno, &eType, &ii);
         4579  +    assert( rc==SQLITE_OK && ii==pNewParent->pgno && eType==PTRMAP_BTREE );
  4578   4580     }
  4579   4581   #endif
  4580   4582   
  4581   4583     return SQLITE_OK;
  4582   4584   }
  4583   4585   
  4584   4586