diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-29 01:59:17 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2000-05-29 01:59:17 +0000 |
commit | 18952f67446da73f938d213b5225b99e95657837 (patch) | |
tree | 7ad26843000b8a17e798dafacbd29baf2d390fa1 /src/pl/tcl/pltcl.c | |
parent | 147ccf5c8045c79a9c8194044359e140c9074ed7 (diff) | |
download | postgresql-18952f67446da73f938d213b5225b99e95657837.tar.gz |
Second round of fmgr changes: triggers are now invoked in new style,
CurrentTriggerData is history.
Diffstat (limited to 'src/pl/tcl/pltcl.c')
-rw-r--r-- | src/pl/tcl/pltcl.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index c968471ed9..201bbdf092 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); |