1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Avoid a test for CURTYPE_BTREE in sqlite3VdbeCursorMoveto() in order to reduce

the size and improve the performance of OP_Column.

FossilOrigin-Name: f078deb25149b7b1881b7f3374b343d0677e82336d8fdd7f1cdd06d926b5dd57
This commit is contained in:
drh
2017-08-16 19:20:20 +00:00
parent 1f613c4df3
commit fe0cf7a18c
8 changed files with 56 additions and 38 deletions

View File

@@ -838,6 +838,17 @@ int sqlite3BtreeCursorHasMoved(BtCursor *pCur){
return pCur->eState!=CURSOR_VALID;
}
/*
** Return a pointer to a fake BtCursor object that will always answer
** false to the sqlite3BtreeCursorHasMoved() routine above. The fake
** cursor returned must not be used with any other Btree interface.
*/
BtCursor *sqlite3BtreeFakeValidCursor(void){
static u8 fakeCursor = CURSOR_VALID;
assert( offsetof(BtCursor, eState)==0 );
return (BtCursor*)&fakeCursor;
}
/*
** This routine restores a cursor back to its original position after it
** has been moved by some outside activity (such as a btree rebalance or