diff --git a/src/common/backend/parser/parse_func.cpp b/src/common/backend/parser/parse_func.cpp index b2c59516453fdacf5dd0f6b3a73464595435f74f..1e7e48f85ce6b1e6ae50ec390554e8e87dbba9d6 100644 --- a/src/common/backend/parser/parse_func.cpp +++ b/src/common/backend/parser/parse_func.cpp @@ -1454,7 +1454,14 @@ FuncCandidateList sort_candidate_func_list(FuncCandidateList oldCandidates) } candidates[smallestIndex] = NULL; } - + + for (int i = 0; i < size; i++) { + if (candidates[i] != NULL) { + lastCandidate->next = candidates[i]; + lastCandidate = lastCandidate->next; + } + } + lastCandidate->next = NULL; pfree(candidates); return sortedCandidates; }