aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/proclang.c
diff options
context:
space:
mode:
authorAlvaro Herrera <alvherre@alvh.no-ip.org>2019-11-12 17:04:46 -0300
committerAlvaro Herrera <alvherre@alvh.no-ip.org>2019-11-12 17:06:58 -0300
commitdcb7d3cafa3197c5425c129ba0dc5eddd23c0532 (patch)
tree9cba76bdf06895c94fc2f8e4528c8c7061af60ad /src/backend/commands/proclang.c
parent8c951687f58ad604be13e6addfd56446afb36e13 (diff)
downloadpostgresql-dcb7d3cafa3197c5425c129ba0dc5eddd23c0532.tar.gz
postgresql-dcb7d3cafa3197c5425c129ba0dc5eddd23c0532.zip
Have LookupFuncName accept NULL argtypes for 0 args
Prior to this change, it requires to be passed a valid pointer just to be able to pass it to a zero-byte memcmp, per 0a52d378b03b. Given the strange resulting code in callsites, it seems better to test for the case specifically and remove the requirement. Reported-by: Ranier Vilela Discussion: https://postgr.es/m/MN2PR18MB2927F24692485D754794F01BE3740@MN2PR18MB2927.namprd18.prod.outlook.com Discussion: https://postgr.es/m/MN2PR18MB2927F6873DF2774A505AC298E3740@MN2PR18MB2927.namprd18.prod.outlook.com
Diffstat (limited to 'src/backend/commands/proclang.c')
-rw-r--r--src/backend/commands/proclang.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/backend/commands/proclang.c b/src/backend/commands/proclang.c
index 343cd1dbb05..b51c373b93f 100644
--- a/src/backend/commands/proclang.c
+++ b/src/backend/commands/proclang.c
@@ -105,7 +105,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
* return type.
*/
funcname = SystemFuncName(pltemplate->tmplhandler);
- handlerOid = LookupFuncName(funcname, 0, funcargtypes, true);
+ handlerOid = LookupFuncName(funcname, 0, NULL, true);
if (OidIsValid(handlerOid))
{
funcrettype = get_func_rettype(handlerOid);
@@ -263,7 +263,7 @@ CreateProceduralLanguage(CreatePLangStmt *stmt)
* Lookup the PL handler function and check that it is of the expected
* return type
*/
- handlerOid = LookupFuncName(stmt->plhandler, 0, funcargtypes, false);
+ handlerOid = LookupFuncName(stmt->plhandler, 0, NULL, false);
funcrettype = get_func_rettype(handlerOid);
if (funcrettype != LANGUAGE_HANDLEROID)
{