summaryrefslogtreecommitdiff
path: root/src/backend/optimizer/path/allpaths.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/optimizer/path/allpaths.c')
-rw-r--r--src/backend/optimizer/path/allpaths.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/backend/optimizer/path/allpaths.c b/src/backend/optimizer/path/allpaths.c
index 7704091db23..7ca9becc119 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -626,6 +626,9 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
else
tuple_fraction = root->tuple_fraction;
+ /* plan_params should not be in use in current query level */
+ Assert(root->plan_params == NIL);
+
/* Generate the plan for the subquery */
rel->subplan = subquery_planner(root->glob, subquery,
root,
@@ -633,6 +636,13 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
&subroot);
rel->subrtable = subroot->parse->rtable;
+ /*
+ * Since we don't yet support LATERAL, it should not be possible for the
+ * sub-query to have requested parameters of this level.
+ */
+ if (root->plan_params)
+ elog(ERROR, "unexpected outer reference in subquery in FROM");
+
/* Copy number of output rows from subplan */
rel->tuples = rel->subplan->plan_rows;