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

Function should_raise_warnings

gpcontrib/orafce/replace_empty_string.c:59–75  ·  view source on GitHub ↗

* Trigger argument is used as parameter that can enforce warning about modified * columns. When first argument is "on" or "true", then warnings will be raised. */

Source from the content-addressed store, hash-verified

57 * columns. When first argument is "on" or "true", then warnings will be raised.
58 */
59static bool
60should_raise_warnings(FunctionCallInfo fcinfo)
61{
62 TriggerData *trigdata = (TriggerData *) fcinfo->context;
63 Trigger *trigger = trigdata->tg_trigger;
64
65 if (trigger->tgnargs > 0)
66 {
67 char **args = trigger->tgargs;
68
69 if (strcmp(args[0], "on") == 0 ||
70 strcmp(args[0], "true") == 0)
71 return true;
72 }
73
74 return false;
75}
76
77/*
78 * Detects emty strings in type text based fields and replaces them by NULL.

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected