summaryrefslogtreecommitdiffstats
path: root/src/backend/optimizer/util/relnode.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/backend/optimizer/util/relnode.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c
index 76dad17..e6d5cd8 100644
--- a/src/backend/optimizer/util/relnode.c
+++ b/src/backend/optimizer/util/relnode.c
@@ -1535,6 +1535,7 @@ get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel,
ParamPathInfo *ppi;
Relids joinrelids;
List *pclauses;
+ List *eqclauses;
Bitmapset *pserials;
double rows;
ListCell *lc;
@@ -1570,14 +1571,25 @@ get_baserel_parampathinfo(PlannerInfo *root, RelOptInfo *baserel,
/*
* Add in joinclauses generated by EquivalenceClasses, too. (These
- * necessarily satisfy join_clause_is_movable_into.)
+ * necessarily satisfy join_clause_is_movable_into; but in assert-enabled
+ * builds, let's verify that.)
*/
- pclauses = list_concat(pclauses,
- generate_join_implied_equalities(root,
- joinrelids,
- required_outer,
- baserel,
- NULL));
+ eqclauses = generate_join_implied_equalities(root,
+ joinrelids,
+ required_outer,
+ baserel,
+ NULL);
+#ifdef USE_ASSERT_CHECKING
+ foreach(lc, eqclauses)
+ {
+ RestrictInfo *rinfo = (RestrictInfo *) lfirst(lc);
+
+ Assert(join_clause_is_movable_into(rinfo,
+ baserel->relids,
+ joinrelids));
+ }
+#endif
+ pclauses = list_concat(pclauses, eqclauses);
/* Compute set of serial numbers of the enforced clauses */
pserials = NULL;