aboutsummaryrefslogtreecommitdiff
path: root/src/select.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/select.c')
-rw-r--r--src/select.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/select.c b/src/select.c
index 420d1f061..4826d65f4 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4203,6 +4203,7 @@ static void findConstInWhere(WhereConst *pConst, Expr *pExpr){
if( pRight->op==TK_COLUMN
&& !ExprHasProperty(pRight, EP_FixedCol)
&& sqlite3ExprIsConstant(pLeft)
+ && sqlite3ExprAffinity(pLeft)==0
&& sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr))
){
constInsert(pConst, pRight, pLeft);
@@ -4210,6 +4211,7 @@ static void findConstInWhere(WhereConst *pConst, Expr *pExpr){
if( pLeft->op==TK_COLUMN
&& !ExprHasProperty(pLeft, EP_FixedCol)
&& sqlite3ExprIsConstant(pRight)
+ && sqlite3ExprAffinity(pRight)==0
&& sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr))
){
constInsert(pConst, pLeft, pRight);