summaryrefslogtreecommitdiff
path: root/src/backend/optimizer
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer')
-rw-r--r--src/backend/optimizer/prep/prepjointree.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/backend/optimizer/prep/prepjointree.c b/src/backend/optimizer/prep/prepjointree.c
index e7e8c1499f2..2c6faad4dae 100644
--- a/src/backend/optimizer/prep/prepjointree.c
+++ b/src/backend/optimizer/prep/prepjointree.c
@@ -908,8 +908,14 @@ preprocess_function_rtes(PlannerInfo *root)
rte->rtekind = RTE_SUBQUERY;
rte->subquery = funcquery;
rte->security_barrier = false;
- /* Clear fields that should not be set in a subquery RTE */
- rte->functions = NIL;
+
+ /*
+ * Clear fields that should not be set in a subquery RTE.
+ * However, we leave rte->functions filled in for the moment,
+ * in case makeWholeRowVar needs to consult it. We'll clear
+ * it in setrefs.c (see add_rte_to_flat_rtable) so that this
+ * abuse of the data structure doesn't escape the planner.
+ */
rte->funcordinality = false;
}
}