1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-16 23:02:26 +03:00

Avoid adding superfluous virtual WHERE clause terms that might arise due

to the constant propagation optimization.

FossilOrigin-Name: cf63abbe559d04f993f99a37d41ba4a97c0261094f1d4cc05cfa23b1e11731f5
This commit is contained in:
drh
2021-05-14 15:37:00 +00:00
parent b775c97682
commit 6a9595a76b
4 changed files with 14 additions and 12 deletions

View File

@@ -996,6 +996,7 @@ static int exprMightBeIndexed(
assert( op<=TK_GE );
if( pExpr->op==TK_VECTOR && (op>=TK_GT && ALWAYS(op<=TK_GE)) ){
pExpr = pExpr->x.pList->a[0].pExpr;
}
if( pExpr->op==TK_COLUMN ){
@@ -1107,6 +1108,7 @@ static void exprAnalyze(
if( op==TK_IS ) pTerm->wtFlags |= TERM_IS;
if( pRight
&& exprMightBeIndexed(pSrc, pTerm->prereqRight, aiCurCol, pRight, op)
&& !ExprHasProperty(pRight, EP_FixedCol)
){
WhereTerm *pNew;
Expr *pDup;