1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-18 10:21:03 +03:00

Fix the query planner so that it is able to use the integer primary key

from an index as part of a multi-column constraint.

FossilOrigin-Name: 96ea9909429f0b3b4a67002e8340ae3f7dc0b73f
This commit is contained in:
drh
2016-03-16 18:26:54 +00:00
parent 32f57d4c37
commit 892ffcc7fc
4 changed files with 11 additions and 10 deletions

View File

@@ -289,6 +289,7 @@ static WhereTerm *whereScanInit(
j = iColumn;
iColumn = pIdx->aiColumn[j];
if( iColumn==XN_EXPR ) pScan->pIdxExpr = pIdx->aColExpr->a[j].pExpr;
if( iColumn==pIdx->pTable->iPKey ) iColumn = XN_ROWID;
}
if( pIdx && iColumn>=0 ){
pScan->idxaff = pIdx->pTable->aCol[iColumn].affinity;
@@ -3929,7 +3930,7 @@ static int whereShortCut(WhereLoopBuilder *pBuilder){
int j;
Table *pTab;
Index *pIdx;
pWInfo = pBuilder->pWInfo;
if( pWInfo->wctrlFlags & WHERE_FORCE_TABLE ) return 0;
assert( pWInfo->pTabList->nSrc>=1 );