1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-22 20:22:44 +03:00

Fix a bug [3557ad65a07] that causes incorrect DISTINCT processing on

an indexed query involving the IN operator.

FossilOrigin-Name: dec9a995d7012a1f85be4edb71240b9d4f07c60e
This commit is contained in:
drh
2012-03-03 00:34:47 +00:00
parent 5b044545d7
commit 7f67d94cfe
3 changed files with 11 additions and 9 deletions

View File

@@ -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;
}