From ed0af3324702685cce63aed0641b4cbb45816b50 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Fri, 20 Jul 2012 22:31:19 -0400 Subject: [PATCH] Revert temporary patch to debug Windows breakage. This reverts commit 0a248208a038d7847ef98996c6b70209d782415c. --- src/pl/plpgsql/src/pl_comp.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 1d542fd661..0dc0e0b37e 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -285,7 +285,6 @@ do_compile(FunctionCallInfo fcinfo, int *in_arg_varnos = NULL; PLpgSQL_variable **out_arg_variables; MemoryContext func_cxt; - PLpgSQL_trigtype fn_is_trigger; /* * Setup the scanner input and error info. We assume that this function @@ -353,12 +352,11 @@ do_compile(FunctionCallInfo fcinfo, function->resolve_option = plpgsql_variable_conflict; if (is_dml_trigger) - fn_is_trigger = PLPGSQL_DML_TRIGGER; + function->fn_is_trigger = PLPGSQL_DML_TRIGGER; else if (is_event_trigger) - fn_is_trigger = PLPGSQL_EVENT_TRIGGER; + function->fn_is_trigger = PLPGSQL_EVENT_TRIGGER; else - fn_is_trigger = PLPGSQL_NOT_TRIGGER; - function->fn_is_trigger = fn_is_trigger; + function->fn_is_trigger = PLPGSQL_NOT_TRIGGER; /* * Initialize the compiler, particularly the namespace stack. The @@ -376,7 +374,6 @@ do_compile(FunctionCallInfo fcinfo, sizeof(PLpgSQL_datum *) * datums_alloc); datums_last = 0; - Assert(fn_is_trigger == function->fn_is_trigger); switch (function->fn_is_trigger) { case PLPGSQL_NOT_TRIGGER: @@ -540,13 +537,9 @@ do_compile(FunctionCallInfo fcinfo, rettypeid == RECORDOID) /* okay */ ; else if (rettypeid == TRIGGEROID || rettypeid == EVTTRIGGEROID) - { ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED), - errmsg("trigger functions can only be called as triggers"), - errhint("CALLED_AS_TRIGGER=%d CALLED_AS_EVENT_TRIGGER=%d", - CALLED_AS_TRIGGER(fcinfo), CALLED_AS_EVENT_TRIGGER(fcinfo)))); - } + errmsg("trigger functions can only be called as triggers"))); else ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),