/ Check-in [a807e718]
Login

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

Overview
Comment:Remove redundant tests from the reparenter in the btree module. (CVS 4909)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: a807e7184b857414ce203af129ac1adf2012096c
User & Date: drh 2008-03-23 00:20:36
Context
2008-03-24
12:51
Improved documentation of sqlite3_blob_open(). (CVS 4910) check-in: 1ed695f5 user: drh tags: trunk
2008-03-23
00:20
Remove redundant tests from the reparenter in the btree module. (CVS 4909) check-in: a807e718 user: drh tags: trunk
2008-03-22
23:59
Bug fix in the newly revised sqllimit1.test script. (CVS 4908) check-in: 2a89fb3c 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.441 2008/03/20 11:04:21 danielk1977 Exp $
           12  +** $Id: btree.c,v 1.442 2008/03/23 00:20:36 drh 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   
................................................................................
  4451   4451     int rc = SQLITE_OK;
  4452   4452   
  4453   4453     assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  4454   4454     if( pPage->leaf ) return SQLITE_OK;
  4455   4455   
  4456   4456     for(i=0; i<pPage->nCell; i++){
  4457   4457       u8 *pCell = findCell(pPage, i);
  4458         -    if( !pPage->leaf ){
  4459         -      rc = reparentPage(pBt, get4byte(pCell), pPage, i);
  4460         -      if( rc!=SQLITE_OK ) return rc;
  4461         -    }
         4458  +    rc = reparentPage(pBt, get4byte(pCell), pPage, i);
         4459  +    if( rc!=SQLITE_OK ) return rc;
  4462   4460     }
  4463         -  if( !pPage->leaf ){
  4464         -    rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]), 
  4465         -       pPage, i);
  4466         -    pPage->idxShift = 0;
  4467         -  }
         4461  +  rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]), 
         4462  +                    pPage, i);
         4463  +  pPage->idxShift = 0;
  4468   4464     return rc;
  4469   4465   }
  4470   4466   
  4471   4467   /*
  4472   4468   ** Remove the i-th cell from pPage.  This routine effects pPage only.
  4473   4469   ** The cell content is not freed or deallocated.  It is assumed that
  4474   4470   ** the cell content has been copied someplace else.  This routine just