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

Fix a harmless compiler warning and restore performance in the

sqlite3BtreeIndexMoveto() last-page optimization.

FossilOrigin-Name: 8b032293b384c3728c27b0658ee634c028c0d231d067de8b747d2e9e4ae704a7
This commit is contained in:
drh
2022-03-11 14:20:06 +00:00
parent 7ef4d75bd2
commit 605137aae6
3 changed files with 12 additions and 11 deletions

View File

@@ -5830,18 +5830,19 @@ int sqlite3BtreeIndexMoveto(
int c;
if( pCur->ix==pCur->pPage->nCell-1
&& (c = indexCellCompare(pCur, pCur->ix, pIdxKey, xRecordCompare))<=0
&& pIdxKey->errCode==SQLITE_OK
){
*pRes = c;
if( pIdxKey->errCode ) return SQLITE_CORRUPT_BKPT;
return SQLITE_OK; /* Cursor already pointing at the correct spot */
}
if( pCur->iPage>0
&& (c = indexCellCompare(pCur, 0, pIdxKey, xRecordCompare))<=0
&& indexCellCompare(pCur, 0, pIdxKey, xRecordCompare)<=0
&& pIdxKey->errCode==SQLITE_OK
){
pCur->curFlags &= ~BTCF_ValidOvfl;
if( pIdxKey->errCode ){ *pRes = 0; return SQLITE_CORRUPT_BKPT; }
goto bypass_moveto_root; /* Start search on the current page */
}
pIdxKey->errCode = SQLITE_OK;
}
rc = moveToRoot(pCur);