aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordrh <drh@noemail.net>2020-04-04 00:15:54 +0000
committerdrh <drh@noemail.net>2020-04-04 00:15:54 +0000
commit2e52a9c611d6db4b1436bb42886ceebe3d5de7ec (patch)
treec66be5976ed852c828fb3d52e17e095b23f566cb /src
parentc59b4acf5d188b8a18a83a576ad53b4212f4a62c (diff)
downloadsqlite-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.c5
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{