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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user