diff options
author | drh <drh@noemail.net> | 2013-08-20 00:42:11 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2013-08-20 00:42:11 +0000 |
commit | 36df58e45ff90c997e6901c8bf18ddd83882d66c (patch) | |
tree | 56b7723beddbf0cfce4e0393dafe229ada31f1b5 /src/btree.c | |
parent | 5805eedb879ca4c245eb5a70fb33d2251d7b3a48 (diff) | |
download | sqlite-36df58e45ff90c997e6901c8bf18ddd83882d66c.tar.gz sqlite-36df58e45ff90c997e6901c8bf18ddd83882d66c.zip |
Performance optimizations in the VDBE and especially to the OP_Next and
related opcodes.
FossilOrigin-Name: d78c5d89de4b840351b026c9db1952fc24e689d0
Diffstat (limited to 'src/btree.c')
-rw-r--r-- | src/btree.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/src/btree.c b/src/btree.c index d3db67652..27f9f412f 100644 --- a/src/btree.c +++ b/src/btree.c @@ -4804,6 +4804,7 @@ int sqlite3BtreeNext(BtCursor *pCur, int *pRes){ if( pCur->eState!=CURSOR_VALID ){ rc = restoreCursorPosition(pCur); if( rc!=SQLITE_OK ){ + *pRes = 0; return rc; } if( CURSOR_INVALID==pCur->eState ){ @@ -4838,7 +4839,10 @@ int sqlite3BtreeNext(BtCursor *pCur, int *pRes){ if( idx>=pPage->nCell ){ if( !pPage->leaf ){ rc = moveToChild(pCur, get4byte(&pPage->aData[pPage->hdrOffset+8])); - if( rc ) return rc; + if( rc ){ + *pRes = 0; + return rc; + } rc = moveToLeftmost(pCur); *pRes = 0; return rc; @@ -4886,7 +4890,10 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ if( pCur->eState!=CURSOR_VALID ){ if( ALWAYS(pCur->eState>=CURSOR_REQUIRESEEK) ){ rc = btreeRestoreCursorPosition(pCur); - if( rc!=SQLITE_OK ) return rc; + if( rc!=SQLITE_OK ){ + *pRes = 0; + return rc; + } } if( CURSOR_INVALID==pCur->eState ){ *pRes = 1; @@ -4910,6 +4917,7 @@ int sqlite3BtreePrevious(BtCursor *pCur, int *pRes){ int idx = pCur->aiIdx[pCur->iPage]; rc = moveToChild(pCur, get4byte(findCell(pPage, idx))); if( rc ){ + *pRes = 0; return rc; } rc = moveToRightmost(pCur); |