/ Check-in [40173010]
Login

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

Overview
Comment:Remove superfluous code from btree.c. (CVS 4964)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1:40173010706fb52ecd60197ce6e97d51a1899267
User & Date: drh 2008-04-03 21:46:57
Context
2008-04-04
12:21
Fix the TCL interface so that it does not use unpublished interfaces. (CVS 4965) check-in: 046a98a8 user: drh tags: trunk
2008-04-03
21:46
Remove superfluous code from btree.c. (CVS 4964) check-in: 40173010 user: drh tags: trunk
21:42
Make sure the zTail return from sqlite3_prepare() is initialized even if there is a malloc failure. (CVS 4963) check-in: 040cffe2 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.450 2008/04/02 18:33:08 drh Exp $
           12  +** $Id: btree.c,v 1.451 2008/04/03 21:46:57 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   
................................................................................
  3776   3776   
  3777   3777   /*
  3778   3778   ** Advance the cursor to the next entry in the database.  If
  3779   3779   ** successful then set *pRes=0.  If the cursor
  3780   3780   ** was already pointing to the last entry in the database before
  3781   3781   ** this routine was called, then set *pRes=1.
  3782   3782   */
  3783         -static int btreeNext(BtCursor *pCur, int *pRes){
         3783  +int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
  3784   3784     int rc;
  3785   3785     MemPage *pPage;
  3786   3786   
  3787   3787     assert( cursorHoldsMutex(pCur) );
  3788   3788     rc = restoreOrClearCursorPosition(pCur);
  3789   3789     if( rc!=SQLITE_OK ){
  3790   3790       return rc;
................................................................................
  3836   3836     *pRes = 0;
  3837   3837     if( pPage->leaf ){
  3838   3838       return SQLITE_OK;
  3839   3839     }
  3840   3840     rc = moveToLeftmost(pCur);
  3841   3841     return rc;
  3842   3842   }
  3843         -int sqlite3BtreeNext(BtCursor *pCur, int *pRes){
  3844         -  int rc;
  3845         -  assert( cursorHoldsMutex(pCur) );
  3846         -  rc = btreeNext(pCur, pRes);
  3847         -  return rc;
  3848         -}
  3849   3843   
  3850   3844   
  3851   3845   /*
  3852   3846   ** Step the cursor to the back to the previous entry in the database.  If
  3853   3847   ** successful then set *pRes=0.  If the cursor
  3854   3848   ** was already pointing to the first entry in the database before
  3855   3849   ** this routine was called, then set *pRes=1.
  3856   3850   */
  3857         -static int btreePrevious(BtCursor *pCur, int *pRes){
         3851  +int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
  3858   3852     int rc;
  3859   3853     Pgno pgno;
  3860   3854     MemPage *pPage;
  3861   3855   
  3862   3856     assert( cursorHoldsMutex(pCur) );
  3863   3857     rc = restoreOrClearCursorPosition(pCur);
  3864   3858     if( rc!=SQLITE_OK ){
................................................................................
  3904   3898       }else{
  3905   3899         rc = SQLITE_OK;
  3906   3900       }
  3907   3901     }
  3908   3902     *pRes = 0;
  3909   3903     return rc;
  3910   3904   }
  3911         -int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){
  3912         -  int rc;
  3913         -  assert( cursorHoldsMutex(pCur) );
  3914         -  rc = btreePrevious(pCur, pRes);
  3915         -  return rc;
  3916         -}
  3917   3905   
  3918   3906   /*
  3919   3907   ** Allocate a new page from the database file.
  3920   3908   **
  3921   3909   ** The new page is marked as dirty.  (In other words, sqlite3PagerWrite()
  3922   3910   ** has already been called on the new page.)  The new page has also
  3923   3911   ** been referenced and the calling routine is responsible for calling