aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 8e2c12818..a8ac3bbcd 100644
--- a/src/where.c
+++ b/src/where.c
@@ -3564,7 +3564,9 @@ static void wherePartIdxExpr(
Expr *pRight = pPart->pRight;
u8 aff;
- assert( pRight->op!=TK_COLUMN );
+ /* Commuting the term is pointless */
+ assert( pRight->op!=TK_COLUMN || !sqlite3ExprIsConstant(pLeft) );
+
if( pLeft->op!=TK_COLUMN ) return;
if( !sqlite3ExprIsConstant(pRight) ) return;
if( !sqlite3IsBinary(sqlite3ExprCompareCollSeq(pParse, pPart)) ) return;