aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2016-03-16 18:26:54 +0000
committerdrh <drh@noemail.net>2016-03-16 18:26:54 +0000
commit892ffcc7fc5b0a6d20c20c64b56096ee8ecbd207 (patch)
tree543a8c7bb5e24f67f0e7bd086549748cc352e94b /src
parent32f57d4c373c8f49b59f4a40149c136ef8a5632b (diff)
downloadsqlite-892ffcc7fc5b0a6d20c20c64b56096ee8ecbd207.tar.gz
sqlite-892ffcc7fc5b0a6d20c20c64b56096ee8ecbd207.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/where.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 83d72ee39..cf23aa62a 100644
--- a/src/where.c
+++ b/src/where.c
@@ -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 );