Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit131e545

Browse files
committed
Fix thinkos in LookupFuncName() for function name lookups
This could trigger valgrind failures when doing ambiguous function namelookups when no arguments are provided by the caller. The problem hasbeen introduced inaefeb68, so backpatch to v10. HEAD is fine thanks tothe refactoring done inbfb456c.Reported-by: Alexander LakhinAuthor: Alexander Lakhin, Michael PaquierDiscussion:https://postgr.es/m/3d068be5-f617-a5ee-99f6-458a407bfd65@gmail.comBackpatch-through: 10
1 parent956611e commit131e545

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

‎src/backend/parser/parse_func.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1950,9 +1950,10 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
19501950
errmsg("function name \"%s\" is not unique",
19511951
NameListToString(funcname)),
19521952
errhint("Specify the argument list to select the function unambiguously.")));
1953+
returnInvalidOid;
19531954
}
1954-
else
1955-
returnclist->oid;
1955+
/* Otherwise return the match */
1956+
returnclist->oid;
19561957
}
19571958
else
19581959
{
@@ -1961,9 +1962,14 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
19611962
(errcode(ERRCODE_UNDEFINED_FUNCTION),
19621963
errmsg("could not find a function named \"%s\"",
19631964
NameListToString(funcname))));
1965+
returnInvalidOid;
19641966
}
19651967
}
19661968

1969+
/*
1970+
* Otherwise, look for a match to the arg types. FuncnameGetCandidates
1971+
* has ensured that there's at most one match in the returned list.
1972+
*/
19671973
while (clist)
19681974
{
19691975
if (memcmp(argtypes,clist->args,nargs*sizeof(Oid))==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp