aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2014-12-16 00:08:31 +0000
committerdrh <drh@noemail.net>2014-12-16 00:08:31 +0000
commit7efa426ee9797653fd23724e7ceaf4a13419fc29 (patch)
tree64cc6205f534e9d19ddb0b97aca670b28456c91e /src
parent9af10620ec84430aa78b3c89656629784bb6a04c (diff)
downloadsqlite-7efa426ee9797653fd23724e7ceaf4a13419fc29.tar.gz
sqlite-7efa426ee9797653fd23724e7ceaf4a13419fc29.zip
Make sure the sqlite3BtreeCount() routine does not leave index cursors in an
inconsistent state, as doing so might result in an assertion fault inside of sqlite3BtreeKey() called from saveAllCursors() if content is deleted out from under the statement that issued the sqlite3BtreeCount() call. FossilOrigin-Name: 5b1b697040116048e464b3ebab8395fe088e389a
Diffstat (limited to 'src')
-rw-r--r--src/btree.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/btree.c b/src/btree.c
index a73c83121..d24f6a876 100644
--- a/src/btree.c
+++ b/src/btree.c
@@ -8278,7 +8278,7 @@ int sqlite3BtreeCount(BtCursor *pCur, i64 *pnEntry){
if( pCur->iPage==0 ){
/* All pages of the b-tree have been visited. Return successfully. */
*pnEntry = nEntry;
- return SQLITE_OK;
+ return moveToRoot(pCur);
}
moveToParent(pCur);
}while ( pCur->aiIdx[pCur->iPage]>=pCur->apPage[pCur->iPage]->nCell );