diff options
Diffstat (limited to 'src/backend/optimizer/prep/prepjointree.c')
-rw-r--r-- | src/backend/optimizer/prep/prepjointree.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c index 62a16687963..b164866c729 100644 --- a/src/backend/optimizer/prep/prepjointree.c +++ b/src/backend/optimizer/prep/prepjointree.c @@ -1801,10 +1801,13 @@ pull_up_constant_function(PlannerInfo *root, Node *jtnode, /* * Convert the RTE to be RTE_RESULT type, signifying that we don't need to - * scan it anymore, and zero out RTE_FUNCTION-specific fields. + * scan it anymore, and zero out RTE_FUNCTION-specific fields. Also make + * sure the RTE is not marked LATERAL, since elsewhere we don't expect + * RTE_RESULTs to be LATERAL. */ rte->rtekind = RTE_RESULT; rte->functions = NIL; + rte->lateral = false; /* * We can reuse the RangeTblRef node. |