/ 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 Unified Diffs Show Whitespace Changes Patch

Changes to src/btree.c.

5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
....
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.441 2008/03/20 11:04:21 danielk1977 Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

................................................................................
  int rc = SQLITE_OK;

  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  if( pPage->leaf ) return SQLITE_OK;

  for(i=0; i<pPage->nCell; i++){
    u8 *pCell = findCell(pPage, i);
    if( !pPage->leaf ){
      rc = reparentPage(pBt, get4byte(pCell), pPage, i);
      if( rc!=SQLITE_OK ) return rc;
    }
  }
  if( !pPage->leaf ){
    rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]), 
       pPage, i);
    pPage->idxShift = 0;
  }
  return rc;
}

/*
** Remove the i-th cell from pPage.  This routine effects pPage only.
** The cell content is not freed or deallocated.  It is assumed that
** the cell content has been copied someplace else.  This routine just







|







 







<



<
<



<







5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
....
4451
4452
4453
4454
4455
4456
4457

4458
4459
4460


4461
4462
4463

4464
4465
4466
4467
4468
4469
4470
** a legal notice, here is a blessing:
**
**    May you do good and not evil.
**    May you find forgiveness for yourself and forgive others.
**    May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.442 2008/03/23 00:20:36 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
** Including a description of file format and an overview of operation.
*/
#include "btreeInt.h"

................................................................................
  int rc = SQLITE_OK;

  assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  if( pPage->leaf ) return SQLITE_OK;

  for(i=0; i<pPage->nCell; i++){
    u8 *pCell = findCell(pPage, i);

    rc = reparentPage(pBt, get4byte(pCell), pPage, i);
    if( rc!=SQLITE_OK ) return rc;
  }


  rc = reparentPage(pBt, get4byte(&pPage->aData[pPage->hdrOffset+8]), 
                    pPage, i);
  pPage->idxShift = 0;

  return rc;
}

/*
** Remove the i-th cell from pPage.  This routine effects pPage only.
** The cell content is not freed or deallocated.  It is assumed that
** the cell content has been copied someplace else.  This routine just