aboutsummaryrefslogtreecommitdiff
path: root/src/backend/optimizer/plan/planner.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/plan/planner.c')
-rw-r--r--src/backend/optimizer/plan/planner.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/optimizer/plan/planner.c b/src/backend/optimizer/plan/planner.c
index 8674ad674d9..db5ff6fdca4 100644
--- a/src/backend/optimizer/plan/planner.c
+++ b/src/backend/optimizer/plan/planner.c
@@ -625,6 +625,7 @@ subquery_planner(PlannerGlobal *glob, Query *parse,
root->init_plans = NIL;
root->cte_plan_ids = NIL;
root->multiexpr_params = NIL;
+ root->join_domains = NIL;
root->eq_classes = NIL;
root->ec_merging_done = false;
root->last_rinfo_serial = 0;
@@ -655,6 +656,13 @@ subquery_planner(PlannerGlobal *glob, Query *parse,
root->partColsUpdated = false;
/*
+ * Create the top-level join domain. This won't have valid contents until
+ * deconstruct_jointree fills it in, but the node needs to exist before
+ * that so we can build EquivalenceClasses referencing it.
+ */
+ root->join_domains = list_make1(makeNode(JoinDomain));
+
+ /*
* If there is a WITH list, process each WITH query and either convert it
* to RTE_SUBQUERY RTE(s) or build an initplan SubPlan structure for it.
*/
@@ -6534,6 +6542,7 @@ plan_cluster_use_sort(Oid tableOid, Oid indexOid)
root->query_level = 1;
root->planner_cxt = CurrentMemoryContext;
root->wt_param_id = -1;
+ root->join_domains = list_make1(makeNode(JoinDomain));
/* Build a minimal RTE for the rel */
rte = makeNode(RangeTblEntry);
@@ -6655,6 +6664,7 @@ plan_create_index_workers(Oid tableOid, Oid indexOid)
root->query_level = 1;
root->planner_cxt = CurrentMemoryContext;
root->wt_param_id = -1;
+ root->join_domains = list_make1(makeNode(JoinDomain));
/*
* Build a minimal RTE.