From 17e320d32263beec20e50a4d3ec66d965f729536 Mon Sep 17 00:00:00 2001 From: Vinoth Veeraraghavan Date: Thu, 15 Oct 2020 20:21:38 +0800 Subject: [PATCH] Fix ForreignPath generation for parameterized IndexPath --- .../storage/mot/fdw_adapter/src/mot_fdw.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gausskernel/storage/mot/fdw_adapter/src/mot_fdw.cpp b/src/gausskernel/storage/mot/fdw_adapter/src/mot_fdw.cpp index 04dc3d8f3..3cebfd558 100644 --- a/src/gausskernel/storage/mot/fdw_adapter/src/mot_fdw.cpp +++ b/src/gausskernel/storage/mot/fdw_adapter/src/mot_fdw.cpp @@ -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; }