@@ -285,7 +285,6 @@ do_compile(FunctionCallInfo fcinfo,
285285int * in_arg_varnos = NULL ;
286286PLpgSQL_variable * * out_arg_variables ;
287287MemoryContext func_cxt ;
288- PLpgSQL_trigtype fn_is_trigger ;
289288
290289/*
291290 * Setup the scanner input and error info.We assume that this function
@@ -353,12 +352,11 @@ do_compile(FunctionCallInfo fcinfo,
353352function -> resolve_option = plpgsql_variable_conflict ;
354353
355354if (is_dml_trigger )
356- fn_is_trigger = PLPGSQL_DML_TRIGGER ;
355+ function -> fn_is_trigger = PLPGSQL_DML_TRIGGER ;
357356else if (is_event_trigger )
358- fn_is_trigger = PLPGSQL_EVENT_TRIGGER ;
357+ function -> fn_is_trigger = PLPGSQL_EVENT_TRIGGER ;
359358else
360- fn_is_trigger = PLPGSQL_NOT_TRIGGER ;
361- function -> fn_is_trigger = fn_is_trigger ;
359+ function -> fn_is_trigger = PLPGSQL_NOT_TRIGGER ;
362360
363361/*
364362 * Initialize the compiler, particularly the namespace stack. The
@@ -376,7 +374,6 @@ do_compile(FunctionCallInfo fcinfo,
376374sizeof (PLpgSQL_datum * )* datums_alloc );
377375datums_last = 0 ;
378376
379- Assert (fn_is_trigger == function -> fn_is_trigger );
380377switch (function -> fn_is_trigger )
381378{
382379case PLPGSQL_NOT_TRIGGER :
@@ -540,13 +537,9 @@ do_compile(FunctionCallInfo fcinfo,
540537rettypeid == RECORDOID )
541538/* okay */ ;
542539else if (rettypeid == TRIGGEROID || rettypeid == EVTTRIGGEROID )
543- {
544540ereport (ERROR ,
545541(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),
546- errmsg ("trigger functions can only be called as triggers" ),
547- errhint ("CALLED_AS_TRIGGER=%d CALLED_AS_EVENT_TRIGGER=%d" ,
548- CALLED_AS_TRIGGER (fcinfo ),CALLED_AS_EVENT_TRIGGER (fcinfo ))));
549- }
542+ errmsg ("trigger functions can only be called as triggers" )));
550543else
551544ereport (ERROR ,
552545(errcode (ERRCODE_FEATURE_NOT_SUPPORTED ),