Fix ForreignPath generation for parameterized IndexPath

This commit is contained in:
Vinoth Veeraraghavan
2020-10-15 20:21:38 +08:00
parent d505a7fc60
commit 17e320d322

View File

@ -696,12 +696,14 @@ static void MOTGetForeignPaths(PlannerInfo* root, RelOptInfo* baserel, Oid forei
set_cheapest(baserel);
if (!IS_PGXC_COORDINATOR && list_length(baserel->cheapest_parameterized_paths) > 0) {
bestPath = (Path*)linitial(baserel->cheapest_parameterized_paths);
if (IsA(bestPath, IndexPath) && bestPath->param_info) {
IndexPath* ip = (IndexPath*)bestPath;
bestClause = ip->indexclauses;
foreach (lc, baserel->cheapest_parameterized_paths) {
bestPath = (Path*)lfirst(lc);
if (IsA(bestPath, IndexPath) && bestPath->param_info) {
IndexPath* ip = (IndexPath*)bestPath;
bestClause = ip->indexclauses;
break;
}
}
usablePathkeys = nullptr;
}