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

Enhance location(X) so that it works with indexes and WITHOUT ROWID tables.

The function might return an offset to the main table or to an index,
depending on whether the column X would be loaded from the main table or
from the index.

FossilOrigin-Name: dd94d6a880dfec4bddd247239b815b84964f804d24841e25f33f1d46a4b5274d
This commit is contained in:
drh
2017-12-29 14:33:54 +00:00
parent 7a8573bafa
commit fe6d20e9f4
7 changed files with 27 additions and 23 deletions

View File

@@ -4439,9 +4439,8 @@ i64 sqlite3BtreeIntegerKey(BtCursor *pCur){
i64 sqlite3BtreeLocation(BtCursor *pCur){
assert( cursorHoldsMutex(pCur) );
assert( pCur->eState==CURSOR_VALID );
assert( pCur->curIntKey );
getCellInfo(pCur);
return (i64)pCur->pBt->pageSize*(i64)pCur->pPage->pgno +
return (i64)pCur->pBt->pageSize*((i64)pCur->pPage->pgno - 1) +
(i64)(pCur->info.pPayload - pCur->pPage->aData);
}