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

Commit52cdbdc

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 parent2839bf3 commit52cdbdc

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
@@ -2059,9 +2059,10 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
20592059
errmsg("function name \"%s\" is not unique",
20602060
NameListToString(funcname)),
20612061
errhint("Specify the argument list to select the function unambiguously.")));
2062+
returnInvalidOid;
20622063
}
2063-
else
2064-
returnclist->oid;
2064+
/* Otherwise return the match */
2065+
returnclist->oid;
20652066
}
20662067
else
20672068
{
@@ -2070,9 +2071,14 @@ LookupFuncName(List *funcname, int nargs, const Oid *argtypes, bool noError)
20702071
(errcode(ERRCODE_UNDEFINED_FUNCTION),
20712072
errmsg("could not find a function named \"%s\"",
20722073
NameListToString(funcname))));
2074+
returnInvalidOid;
20732075
}
20742076
}
20752077

2078+
/*
2079+
* Otherwise, look for a match to the arg types. FuncnameGetCandidates
2080+
* has ensured that there's at most one match in the returned list.
2081+
*/
20762082
while (clist)
20772083
{
20782084
if (memcmp(argtypes,clist->args,nargs*sizeof(Oid))==0)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp