aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-02-13 22:12:35 +0000
committerdrh <drh@noemail.net>2020-02-13 22:12:35 +0000
commitfdfd45aef3c8ed91278f4bddff6b421472e49f10 (patch)
tree00534af561f391fbaf5bd7a25287c6fa10954af9 /src
parentab7fdca2eec1b6d5143214155aa9dfda40de1b83 (diff)
downloadsqlite-fdfd45aef3c8ed91278f4bddff6b421472e49f10.tar.gz
sqlite-fdfd45aef3c8ed91278f4bddff6b421472e49f10.zip
Fix problems in the constant propagation optimization that were introduced
by check-in [1c3e5c20a9e6f501]. Fix for ticket [1dcb4d44964846ad] FossilOrigin-Name: c9a8defcef35a1fee6bcbb88252a2d0076dabe8381b0128b2257b5b5cc494e0f
Diffstat (limited to 'src')
-rw-r--r--src/select.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/select.c b/src/select.c
index 6f8d45c4e..d03322fcb 100644
--- a/src/select.c
+++ b/src/select.c
@@ -4166,9 +4166,8 @@ static void constInsert(
assert( pColumn->op==TK_COLUMN );
assert( sqlite3ExprIsConstant(pValue) );
- if( !ExprHasProperty(pValue, EP_FixedCol) && sqlite3ExprAffinity(pValue)!=0 ){
- return;
- }
+ if( ExprHasProperty(pColumn, EP_FixedCol) ) return;
+ if( sqlite3ExprAffinity(pValue)!=0 ) return;
if( !sqlite3IsBinary(sqlite3ExprCompareCollSeq(pConst->pParse,pExpr)) ){
return;
}
@@ -4191,9 +4190,6 @@ static void constInsert(
if( pConst->apExpr==0 ){
pConst->nConst = 0;
}else{
- if( ExprHasProperty(pValue, EP_FixedCol) ){
- pValue = pValue->pLeft;
- }
pConst->apExpr[pConst->nConst*2-2] = pColumn;
pConst->apExpr[pConst->nConst*2-1] = pValue;
}