MCPcopy Create free account
hub / github.com/apache/cloudberry / trigger_sanity_check

Function trigger_sanity_check

gpcontrib/orafce/replace_empty_string.c:19–36  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

17PG_FUNCTION_INFO_V1(orafce_replace_null_strings);
18
19static void
20trigger_sanity_check(FunctionCallInfo fcinfo, const char *fname)
21{
22 TriggerData *trigdata = (TriggerData *) fcinfo->context;
23
24 /* sanity checks from autoinc.c */
25 if (!CALLED_AS_TRIGGER(fcinfo))
26 elog(ERROR, "%s: not fired by trigger manager", fname);
27
28 if (!TRIGGER_FIRED_FOR_ROW(trigdata->tg_event))
29 elog(ERROR, "%s: must be fired for row", fname);
30
31 if (!TRIGGER_FIRED_BEFORE(trigdata->tg_event))
32 elog(ERROR, "%s: must be fired before event", fname);
33
34 if (trigdata->tg_trigger->tgnargs > 1)
35 elog(ERROR, "%s: only one trigger parameter is allowed", fname);
36}
37
38static HeapTuple
39get_rettuple(FunctionCallInfo fcinfo)

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected