diff options
author | drh <drh@noemail.net> | 2020-04-04 00:15:54 +0000 |
---|---|---|
committer | drh <drh@noemail.net> | 2020-04-04 00:15:54 +0000 |
commit | 2e52a9c611d6db4b1436bb42886ceebe3d5de7ec (patch) | |
tree | c66be5976ed852c828fb3d52e17e095b23f566cb /src | |
parent | c59b4acf5d188b8a18a83a576ad53b4212f4a62c (diff) | |
download | sqlite-2e52a9c611d6db4b1436bb42886ceebe3d5de7ec.tar.gz sqlite-2e52a9c611d6db4b1436bb42886ceebe3d5de7ec.zip |
In the push-down optimization, do not substitute columns that have previously
been identified as being constant by the propagate-constants optimization.
Fix for ticket [51166be0159fd2ce]
FossilOrigin-Name: 70c44811d12f540d4ec1c29dedbe999cf79b82e326a8712ae2fa0725d6bd8a65
Diffstat (limited to 'src')
-rw-r--r-- | src/select.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/select.c b/src/select.c index 59ba706fc..ce85c91d0 100644 --- a/src/select.c +++ b/src/select.c @@ -3476,7 +3476,10 @@ static Expr *substExpr( ){ pExpr->iRightJoinTable = pSubst->iNewTable; } - if( pExpr->op==TK_COLUMN && pExpr->iTable==pSubst->iTable ){ + if( pExpr->op==TK_COLUMN + && pExpr->iTable==pSubst->iTable + && !ExprHasProperty(pExpr, EP_FixedCol) + ){ if( pExpr->iColumn<0 ){ pExpr->op = TK_NULL; }else{ |