From dcb7d3cafa3197c5425c129ba0dc5eddd23c0532 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 12 Nov 2019 17:04:46 -0300 Subject: 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 --- src/backend/commands/trigger.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'src/backend/commands/trigger.c') diff --git a/src/backend/commands/trigger.c b/src/backend/commands/trigger.c index cef6d02f51..84144b46b1 100644 --- a/src/backend/commands/trigger.c +++ b/src/backend/commands/trigger.c @@ -179,7 +179,6 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, ScanKeyData key; Relation pgrel; HeapTuple tuple; - Oid fargtypes[1]; /* dummy */ Oid funcrettype; Oid trigoid; char internaltrigname[NAMEDATALEN]; @@ -690,7 +689,7 @@ CreateTrigger(CreateTrigStmt *stmt, const char *queryString, * Find and validate the trigger function. */ if (!OidIsValid(funcoid)) - funcoid = LookupFuncName(stmt->funcname, 0, fargtypes, false); + funcoid = LookupFuncName(stmt->funcname, 0, NULL, false); if (!isInternal) { aclresult = pg_proc_aclcheck(funcoid, GetUserId(), ACL_EXECUTE); -- cgit v1.2.1