diff options
author | Robert Haas <rhaas@postgresql.org> | 2016-03-23 12:28:01 -0400 |
---|---|---|
committer | Robert Haas <rhaas@postgresql.org> | 2016-03-23 12:28:01 -0400 |
commit | 3151f16e1874db82ed85a005dac15368903ca9fb (patch) | |
tree | e527ae211ee72b58a0d0edda17d005d5dd307360 /contrib/postgres_fdw/postgres_fdw.c | |
parent | 44ca4022f3f9297bab5cbffdd97973dbba1879ed (diff) | |
download | postgresql-3151f16e1874db82ed85a005dac15368903ca9fb.tar.gz postgresql-3151f16e1874db82ed85a005dac15368903ca9fb.zip |
postgres_fdw: Fix crash when pushing down multiple joins.
A join clause might mention multiple relations on either side, so it
need not be the case that a given joinrel's constituent relations are
all on one side of the join clause or all on the other.
Report by Rajkumar Raghuwanshi. Analysis and fix by Michael Paquier
and Ashutosh Bapat.
Diffstat (limited to 'contrib/postgres_fdw/postgres_fdw.c')
-rw-r--r-- | contrib/postgres_fdw/postgres_fdw.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/contrib/postgres_fdw/postgres_fdw.c b/contrib/postgres_fdw/postgres_fdw.c index 9600e3b3c45..f21689e73d1 100644 --- a/contrib/postgres_fdw/postgres_fdw.c +++ b/contrib/postgres_fdw/postgres_fdw.c @@ -727,12 +727,9 @@ get_useful_ecs_for_relation(PlannerInfo *root, RelOptInfo *rel) if (bms_is_subset(relids, restrictinfo->right_ec->ec_relids)) useful_eclass_list = list_append_unique_ptr(useful_eclass_list, restrictinfo->right_ec); - else - { - Assert(bms_is_subset(relids, restrictinfo->left_ec->ec_relids)); + else if (bms_is_subset(relids, restrictinfo->left_ec->ec_relids)) useful_eclass_list = list_append_unique_ptr(useful_eclass_list, restrictinfo->left_ec); - } } return useful_eclass_list; |