/ Check-in [0c5a7d11]
Login

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

Overview
Comment:In pageReinit() in btree.c, only reinitialize a page if there are one or more references to it, not including the transient reference held by pager.c. This was always the intent. (CVS 6424)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 0c5a7d1117cfb322d1c89da89e8887b0bb091602
User & Date: danielk1977 2009-04-01 17:13:51
Context
2009-04-01
18:03
Remove the unused SQLITE_Vtab flag. (CVS 6425) check-in: fdd78962 user: danielk1977 tags: trunk
17:13
In pageReinit() in btree.c, only reinitialize a page if there are one or more references to it, not including the transient reference held by pager.c. This was always the intent. (CVS 6424) check-in: 0c5a7d11 user: danielk1977 tags: trunk
16:33
Remove dead code from the UTF conversion routines. Fix a bug in sqlite3_prepare16_v2() in which an out-of-memory error fails to set the statement return pointer to NULL. (CVS 6423) check-in: 94e2f815 user: drh 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.584 2009/04/01 16:25:33 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.585 2009/04/01 17:13:51 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   
................................................................................
  1316   1316   **
  1317   1317   ** This routine needs to reset the extra data section at the end of the
  1318   1318   ** page to agree with the restored data.
  1319   1319   */
  1320   1320   static void pageReinit(DbPage *pData){
  1321   1321     MemPage *pPage;
  1322   1322     pPage = (MemPage *)sqlite3PagerGetExtra(pData);
         1323  +  assert( sqlite3PagerPageRefcount(pData)>0 );
  1323   1324     if( pPage->isInit ){
  1324   1325       assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  1325   1326       pPage->isInit = 0;
  1326         -    if( sqlite3PagerPageRefcount(pData)>0 ){
         1327  +    if( sqlite3PagerPageRefcount(pData)>1 ){
  1327   1328         /* pPage might not be a btree page;  it might be an overflow page
  1328   1329         ** or ptrmap page or a free page.  In those cases, the following
  1329   1330         ** call to sqlite3BtreeInitPage() will likely return SQLITE_CORRUPT.
  1330   1331         ** But no harm is done by this.  And it is very important that
  1331   1332         ** sqlite3BtreeInitPage() be called on every btree page so we make
  1332   1333         ** the call for every page that comes in for re-initing. */
  1333   1334         sqlite3BtreeInitPage(pPage);