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 f02954982a7..654ee5849b1 100644
--- a/src/backend/optimizer/path/allpaths.c
+++ b/src/backend/optimizer/path/allpaths.c
@@ -1109,6 +1109,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,
@@ -1117,6 +1120,13 @@ set_subquery_pathlist(PlannerInfo *root, RelOptInfo *rel,
rel->subroot = subroot;
/*
+ * 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");
+
+ /*
* It's possible that constraint exclusion proved the subquery empty. If
* so, it's convenient to turn it back into a dummy path so that we will
* recognize appropriate optimizations at this level.