diff --git a/doc/src/sgml/fdwhandler.sgml b/doc/src/sgml/fdwhandler.sgml index d25d5c9..77477c8 100644 --- a/doc/src/sgml/fdwhandler.sgml +++ b/doc/src/sgml/fdwhandler.sgml @@ -603,15 +603,15 @@ IsForeignRelUpdatable (Relation rel); void -GetForeignJoinPath(PlannerInfo *root, - RelOptInfo *joinrel, - RelOptInfo *outerrel, - RelOptInfo *innerrel, - JoinType jointype, - SpecialJoinInfo *sjinfo, - SemiAntiJoinFactors *semifactors, - List *restrictlist, - Relids extra_lateral_rels); +GetForeignJoinPaths(PlannerInfo *root, + RelOptInfo *joinrel, + RelOptInfo *outerrel, + RelOptInfo *innerrel, + JoinType jointype, + SpecialJoinInfo *sjinfo, + SemiAntiJoinFactors *semifactors, + List *restrictlist, + Relids extra_lateral_rels); Create possible access paths for a join of two foreign tables or joined relations, but both of them needs to be managed with same diff --git a/src/backend/optimizer/path/joinpath.c b/src/backend/optimizer/path/joinpath.c index d68164c..03d5781 100644 --- a/src/backend/optimizer/path/joinpath.c +++ b/src/backend/optimizer/path/joinpath.c @@ -280,19 +280,19 @@ add_paths_to_joinrel(PlannerInfo *root, /* * 6. Consider paths added by FDWs when both outer and inner relations are * managed by same foreign-data wrapper. Matching of foreign server and/or - * checkAsUser should be checked in GetForeignJoinPath by the FDW. + * checkAsUser should be checked in GetForeignJoinPaths by the FDW. */ - if (joinrel->fdwroutine && joinrel->fdwroutine->GetForeignJoinPath) + if (joinrel->fdwroutine && joinrel->fdwroutine->GetForeignJoinPaths) { - joinrel->fdwroutine->GetForeignJoinPath(root, - joinrel, - outerrel, - innerrel, - jointype, - sjinfo, - &semifactors, - restrictlist, - extra_lateral_rels); + joinrel->fdwroutine->GetForeignJoinPaths(root, + joinrel, + outerrel, + innerrel, + jointype, + sjinfo, + &semifactors, + restrictlist, + extra_lateral_rels); } } diff --git a/src/backend/optimizer/util/relnode.c b/src/backend/optimizer/util/relnode.c index ca71093..5623566 100644 --- a/src/backend/optimizer/util/relnode.c +++ b/src/backend/optimizer/util/relnode.c @@ -123,6 +123,7 @@ build_simple_rel(PlannerInfo *root, int relid, RelOptKind reloptkind) rel->subroot = NULL; rel->subplan_params = NIL; rel->fdwroutine = NULL; + rel->fdw_handler = InvalidOid; rel->fdw_private = NULL; rel->baserestrictinfo = NIL; rel->baserestrictcost.startup = 0; diff --git a/src/include/foreign/fdwapi.h b/src/include/foreign/fdwapi.h index d4ab71a..5a8bd39 100644 --- a/src/include/foreign/fdwapi.h +++ b/src/include/foreign/fdwapi.h @@ -82,15 +82,15 @@ typedef void (*EndForeignModify_function) (EState *estate, typedef int (*IsForeignRelUpdatable_function) (Relation rel); -typedef void (*GetForeignJoinPath_function ) (PlannerInfo *root, - RelOptInfo *joinrel, - RelOptInfo *outerrel, - RelOptInfo *innerrel, - JoinType jointype, - SpecialJoinInfo *sjinfo, - SemiAntiJoinFactors *semifactors, - List *restrictlist, - Relids extra_lateral_rels); +typedef void (*GetForeignJoinPaths_function ) (PlannerInfo *root, + RelOptInfo *joinrel, + RelOptInfo *outerrel, + RelOptInfo *innerrel, + JoinType jointype, + SpecialJoinInfo *sjinfo, + SemiAntiJoinFactors *semifactors, + List *restrictlist, + Relids extra_lateral_rels); typedef void (*ExplainForeignScan_function) (ForeignScanState *node, struct ExplainState *es); @@ -162,7 +162,7 @@ typedef struct FdwRoutine ImportForeignSchema_function ImportForeignSchema; /* Support functions for join push-down */ - GetForeignJoinPath_function GetForeignJoinPath; + GetForeignJoinPaths_function GetForeignJoinPaths; } FdwRoutine;