aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/select.c b/src/select.c
index ac8b1b6ae..69a07528f 100644
--- a/src/select.c
+++ b/src/select.c
@@ -7332,8 +7332,8 @@ static u64 findConstIdxTerms(
m = findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pLeft);
m |= findConstIdxTerms(pParse, iCsr, pIdx, pWhere->pRight);
}else if( pWhere->op==TK_EQ ){
- Expr *pLeft = pWhere->pLeft;
- Expr *pRight = pWhere->pRight;
+ Expr *pLeft = sqlite3ExprSkipCollateAndLikely(pWhere->pLeft);
+ Expr *pRight = sqlite3ExprSkipCollateAndLikely(pWhere->pRight);
if( pRight->op==TK_COLUMN && pRight->iTable==iCsr ){
SWAP(Expr*, pLeft, pRight);
}