diff options
author | drh <> | 2023-09-26 19:38:24 +0000 |
---|---|---|
committer | drh <> | 2023-09-26 19:38:24 +0000 |
commit | 0e224d93ea2188a9ce7815126fdfce27e8f3921e (patch) | |
tree | 33c630d9aff2061a14c3271fb14c945d4e6dd3b8 /src | |
parent | 1c67749166f1452ab6324b9c57a78d8eff354d24 (diff) | |
download | sqlite-0e224d93ea2188a9ce7815126fdfce27e8f3921e.tar.gz sqlite-0e224d93ea2188a9ce7815126fdfce27e8f3921e.zip |
Fix yet another assert() in the partial-index constant value optimization.
FossilOrigin-Name: f459d0806cf044fd07743e4c91d0a5a6ddf45b3b41004bde4278f190d99a4cf5
Diffstat (limited to 'src')
-rw-r--r-- | src/where.c | 4 |
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; |