summaryrefslogtreecommitdiff
path: root/src/backend/commands/event_trigger.c
diff options
context:
space:
mode:
authorAlvaro Herrera2019-11-12 20:04:46 +0000
committerAlvaro Herrera2019-11-12 20:06:58 +0000
commitdcb7d3cafa3197c5425c129ba0dc5eddd23c0532 (patch)
tree9cba76bdf06895c94fc2f8e4528c8c7061af60ad /src/backend/commands/event_trigger.c
parent8c951687f58ad604be13e6addfd56446afb36e13 (diff)
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/event_trigger.c')
-rw-r--r--src/backend/commands/event_trigger.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/backend/commands/event_trigger.c b/src/backend/commands/event_trigger.c
index 6b022af4ab9..f021d71a5cb 100644
--- a/src/backend/commands/event_trigger.c
+++ b/src/backend/commands/event_trigger.c
@@ -171,7 +171,6 @@ CreateEventTrigger(CreateEventTrigStmt *stmt)
HeapTuple tuple;
Oid funcoid;
Oid funcrettype;
- Oid fargtypes[1]; /* dummy */
Oid evtowner = GetUserId();
ListCell *lc;
List *tags = NULL;
@@ -237,7 +236,7 @@ CreateEventTrigger(CreateEventTrigStmt *stmt)
stmt->trigname)));
/* Find and validate the trigger function. */
- funcoid = LookupFuncName(stmt->funcname, 0, fargtypes, false);
+ funcoid = LookupFuncName(stmt->funcname, 0, NULL, false);
funcrettype = get_func_rettype(funcoid);
if (funcrettype != EVTTRIGGEROID)
ereport(ERROR,