/ Check-in [579ba6c8]
Login

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

Overview
Comment:removed the test function sqlite3BtreeFlags() (test code only); (CVS 6868)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 579ba6c83f52d26860e5152f06355aa4f49e568d
User & Date: shane 2009-07-09 03:20:46
Context
2009-07-09
05:07
Restore (btree_set_cache_size) to test3.c. This is used on unix for the tcl "crash tests". Make some functions no longer used outside of btree.c static. (CVS 6869) check-in: 1d96ce8c user: danielk1977 tags: trunk
03:20
removed the test function sqlite3BtreeFlags() (test code only); (CVS 6868) check-in: 579ba6c8 user: shane tags: trunk
02:48
removed unused functions from test3.c (test code only); (CVS 6867) check-in: 0eb69e8d user: shane 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.667 2009/07/09 02:48:24 shane Exp $
           12  +** $Id: btree.c,v 1.668 2009/07/09 03:20:46 shane 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   
................................................................................
  7009   7009       }
  7010   7010   #endif
  7011   7011     }
  7012   7012     sqlite3BtreeLeave(p);
  7013   7013     return rc;
  7014   7014   }
  7015   7015   
  7016         -#ifdef SQLITE_TEST
  7017         -/*
  7018         -** Return the flag byte at the beginning of the page that the cursor
  7019         -** is currently pointing to.
  7020         -*/
  7021         -int sqlite3BtreeFlags(BtCursor *pCur){
  7022         -  /* TODO: What about CURSOR_REQUIRESEEK state? Probably need to call
  7023         -  ** restoreCursorPosition() here.
  7024         -  */
  7025         -  MemPage *pPage;
  7026         -  restoreCursorPosition(pCur);
  7027         -  pPage = pCur->apPage[pCur->iPage];
  7028         -  assert( cursorHoldsMutex(pCur) );
  7029         -  assert( pPage!=0 );
  7030         -  assert( pPage->pBt==pCur->pBt );
  7031         -  return pPage->aData[pPage->hdrOffset];
  7032         -}
  7033         -#endif
  7034         -
  7035   7016   #ifndef SQLITE_OMIT_BTREECOUNT
  7036   7017   /*
  7037   7018   ** The first argument, pCur, is a cursor opened on some b-tree. Count the
  7038   7019   ** number of entries in the b-tree and write the result to *pnEntry.
  7039   7020   **
  7040   7021   ** SQLITE_OK is returned if the operation is successfully executed. 
  7041   7022   ** Otherwise, if an error is encountered (i.e. an IO error or database

Changes to src/test3.c.

     9      9   **    May you share freely, never taking more than you give.
    10     10   **
    11     11   *************************************************************************
    12     12   ** Code for testing the btree.c module in SQLite.  This code
    13     13   ** is not included in the SQLite library.  It is used for automated
    14     14   ** testing of the SQLite library.
    15     15   **
    16         -** $Id: test3.c,v 1.109 2009/07/09 02:48:24 shane Exp $
           16  +** $Id: test3.c,v 1.110 2009/07/09 03:20:46 shane Exp $
    17     17   */
    18     18   #include "sqliteInt.h"
    19     19   #include "btreeInt.h"
    20     20   #include "tcl.h"
    21     21   #include <stdlib.h>
    22     22   #include <string.h>
    23     23   
................................................................................
   404    404     if( argc!=2 ){
   405    405       Tcl_AppendResult(interp, "wrong # args: should be \"", argv[0],
   406    406          " ID\"", 0);
   407    407       return TCL_ERROR;
   408    408     }
   409    409     pCur = sqlite3TestTextToPtr(argv[1]);
   410    410     sqlite3BtreeEnter(pCur->pBtree);
   411         -  if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){
          411  +  if (pCur->eState>=CURSOR_REQUIRESEEK) sqlite3BtreeRestoreCursorPosition(pCur);
          412  +  if( pCur->apPage[pCur->iPage]->intKey ){
   412    413       n1 = 0;
   413    414     }else{
   414    415       sqlite3BtreeKeySize(pCur, (i64*)&n1);
   415    416     }
   416    417     sqlite3BtreeDataSize(pCur, (u32*)&n2);
   417    418     sqlite3BtreeLeave(pCur->pBtree);
   418    419     sqlite3_snprintf(sizeof(zBuf),zBuf, "%d", (int)(n1+n2));