Index: src/btree.c ================================================================== --- src/btree.c +++ src/btree.c @@ -7,11 +7,11 @@ ** 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.667 2009/07/09 02:48:24 shane Exp $ +** $Id: btree.c,v 1.668 2009/07/09 03:20:46 shane 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. */ @@ -7011,29 +7011,10 @@ } sqlite3BtreeLeave(p); return rc; } -#ifdef SQLITE_TEST -/* -** Return the flag byte at the beginning of the page that the cursor -** is currently pointing to. -*/ -int sqlite3BtreeFlags(BtCursor *pCur){ - /* TODO: What about CURSOR_REQUIRESEEK state? Probably need to call - ** restoreCursorPosition() here. - */ - MemPage *pPage; - restoreCursorPosition(pCur); - pPage = pCur->apPage[pCur->iPage]; - assert( cursorHoldsMutex(pCur) ); - assert( pPage!=0 ); - assert( pPage->pBt==pCur->pBt ); - return pPage->aData[pPage->hdrOffset]; -} -#endif - #ifndef SQLITE_OMIT_BTREECOUNT /* ** The first argument, pCur, is a cursor opened on some b-tree. Count the ** number of entries in the b-tree and write the result to *pnEntry. ** Index: src/test3.c ================================================================== --- src/test3.c +++ src/test3.c @@ -11,11 +11,11 @@ ************************************************************************* ** Code for testing the btree.c module in SQLite. This code ** is not included in the SQLite library. It is used for automated ** testing of the SQLite library. ** -** $Id: test3.c,v 1.109 2009/07/09 02:48:24 shane Exp $ +** $Id: test3.c,v 1.110 2009/07/09 03:20:46 shane Exp $ */ #include "sqliteInt.h" #include "btreeInt.h" #include "tcl.h" #include @@ -406,11 +406,12 @@ " ID\"", 0); return TCL_ERROR; } pCur = sqlite3TestTextToPtr(argv[1]); sqlite3BtreeEnter(pCur->pBtree); - if( sqlite3BtreeFlags(pCur) & BTREE_INTKEY ){ + if (pCur->eState>=CURSOR_REQUIRESEEK) sqlite3BtreeRestoreCursorPosition(pCur); + if( pCur->apPage[pCur->iPage]->intKey ){ n1 = 0; }else{ sqlite3BtreeKeySize(pCur, (i64*)&n1); } sqlite3BtreeDataSize(pCur, (u32*)&n2);