mirror of
https://github.com/postgres/postgres.git
synced 2025-06-11 20:28:21 +03:00
postgres_fdw: Fix interaction of PHVs with child joins.
Commit f49842d1ee
introduced the
concept of a child join, but did not update this code accordingly.
Ashutosh Bapat, with cosmetic changes by me
Discussion: http://postgr.es/m/CAFjFpRf=J_KPOtw+bhZeURYkbizr8ufSaXg6gPEF6DKpgH-t6g@mail.gmail.com
This commit is contained in:
@ -4565,7 +4565,11 @@ foreign_join_ok(PlannerInfo *root, RelOptInfo *joinrel, JoinType jointype,
|
||||
foreach(lc, root->placeholder_list)
|
||||
{
|
||||
PlaceHolderInfo *phinfo = lfirst(lc);
|
||||
Relids relids = joinrel->relids;
|
||||
Relids relids;
|
||||
|
||||
/* PlaceHolderInfo refers to parent relids, not child relids. */
|
||||
relids = IS_OTHER_REL(joinrel) ?
|
||||
joinrel->top_parent_relids : joinrel->relids;
|
||||
|
||||
if (bms_is_subset(phinfo->ph_eval_at, relids) &&
|
||||
bms_nonempty_difference(relids, phinfo->ph_eval_at))
|
||||
|
Reference in New Issue
Block a user