aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2012-03-03 00:34:47 +0000
committerdrh <drh@noemail.net>2012-03-03 00:34:47 +0000
commit7f67d94cfe8eb49e62cf6766bc409b6831f4634c (patch)
treed7f47482d757c2a6906689970cf0d8b141c6b680 /src
parent5b044545d703500c4487bfc74165ca318bece20e (diff)
downloadsqlite-7f67d94cfe8eb49e62cf6766bc409b6831f4634c.tar.gz
sqlite-7f67d94cfe8eb49e62cf6766bc409b6831f4634c.zip
Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on
an indexed query involving the IN operator. FossilOrigin-Name: dec9a995d7012a1f85be4edb71240b9d4f07c60e
Diffstat (limited to 'src')
-rw-r--r--src/where.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/where.c b/src/where.c
index 78efbf979..eda8d5fb8 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3103,7 +3103,9 @@ static void bestBtreeIndex(
/* If there is a DISTINCT qualifier and this index will scan rows in
** order of the DISTINCT expressions, clear bDist and set the appropriate
** flags in wsFlags. */
- if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq) ){
+ if( isDistinctIndex(pParse, pWC, pProbe, iCur, pDistinct, nEq)
+ && (wsFlags & WHERE_COLUMN_IN)==0
+ ){
bDist = 0;
wsFlags |= WHERE_ROWID_RANGE|WHERE_COLUMN_RANGE|WHERE_DISTINCT;
}