Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 1f115d9

Browse files
committed
Suppress volatile-related warning seen in some compilers.
Antique versions of gcc complain about vars that are initialized outside PG_TRY and then modified within it. Rather than marking the var volatile, expend one more line of code.
1 parent 31c7c64 commit 1f115d9

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/pl/plpgsql/src/pl_handler.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ plpgsql_call_handler(PG_FUNCTION_ARGS)
9191
{
9292
PLpgSQL_function *func;
9393
PLpgSQL_execstate *save_cur_estate;
94-
Datum retval = 0; /* make compiler happy */
94+
Datum retval;
9595
int rc;
9696

9797
/*
@@ -119,8 +119,11 @@ plpgsql_call_handler(PG_FUNCTION_ARGS)
119119
retval = PointerGetDatum(plpgsql_exec_trigger(func,
120120
(TriggerData *) fcinfo->context));
121121
else if (CALLED_AS_EVENT_TRIGGER(fcinfo))
122+
{
122123
plpgsql_exec_event_trigger(func,
123124
(EventTriggerData *) fcinfo->context);
125+
retval = (Datum) 0;
126+
}
124127
else
125128
retval = plpgsql_exec_function(func, fcinfo);
126129
}

0 commit comments

Comments
 (0)