mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
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.
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user