1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-11 01:42:22 +03:00

Fix the constant propagation optimization so that it does not try to

propagate constant expressions that have affinity.  Ticket [82ac75ba0093e5dc]

FossilOrigin-Name: 6db1c3498f6bfa01bb460e62b802b63ec4bf43577a17a94e1e2fa0ecc1e64960
This commit is contained in:
drh
2020-01-08 01:43:47 +00:00
parent 97bffe674f
commit c9301e6e7c
4 changed files with 33 additions and 8 deletions

View File

@@ -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);