aboutsummaryrefslogtreecommitdiff
path: root/src/pl/tcl/pltcl.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/pl/tcl/pltcl.c')
-rw-r--r--src/pl/tcl/pltcl.c16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index c968471ed94..201bbdf092d 100644
--- a/src/pl/tcl/pltcl.c
+++ b/src/pl/tcl/pltcl.c
@@ -31,7 +31,7 @@
* ENHANCEMENTS, OR MODIFICATIONS.
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.23 2000/05/28 17:56:29 tgl Exp $
+ * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.24 2000/05/29 01:59:15 tgl Exp $
*
**********************************************************************/
@@ -390,10 +390,10 @@ pltcl_call_handler(PG_FUNCTION_ARGS)
* Determine if called as function or trigger and
* call appropriate subhandler
************************************************************/
- if (CurrentTriggerData == NULL)
- retval = pltcl_func_handler(fcinfo);
+ if (CALLED_AS_TRIGGER(fcinfo))
+ retval = PointerGetDatum(pltcl_trigger_handler(fcinfo));
else
- retval = (Datum) pltcl_trigger_handler(fcinfo);
+ retval = pltcl_func_handler(fcinfo);
pltcl_call_level--;
@@ -734,7 +734,7 @@ pltcl_func_handler(PG_FUNCTION_ARGS)
static HeapTuple
pltcl_trigger_handler(PG_FUNCTION_ARGS)
{
- TriggerData *trigdata;
+ TriggerData *trigdata = (TriggerData *) fcinfo->context;
char internal_proname[512];
char *stroid;
Tcl_HashEntry *hashent;
@@ -758,12 +758,6 @@ pltcl_trigger_handler(PG_FUNCTION_ARGS)
sigjmp_buf save_restart;
/************************************************************
- * Save the current trigger data local
- ************************************************************/
- trigdata = CurrentTriggerData;
- CurrentTriggerData = NULL;
-
- /************************************************************
* Build our internal proc name from the functions Oid
************************************************************/
sprintf(internal_proname, "__PLTcl_proc_%u", fcinfo->flinfo->fn_oid);