diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-21 18:16:08 -0400 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-21 18:16:08 -0400 |
| commit | 52120ee8346aa42d26e4c2244574df4d90f4bda6 (patch) | |
| tree | 6927a43174138a5abe84beb3f97e7de662836895 /src/backend/executor | |
| parent | 706493a1f7cbd9c7d3a792fd5066b55c145b9b01 (diff) | |
Fix trigger WHEN conditions when both BEFORE and AFTER triggers exist.
Due to tuple-slot mismanagement, evaluation of WHEN conditions for AFTER
ROW UPDATE triggers could crash if there had been a BEFORE ROW trigger
fired for the same update. Fix by not trying to overload the use of
estate->es_trig_tuple_slot. Per report from Yoran Heling.
Back-patch to 9.0, when trigger WHEN conditions were introduced.
Diffstat (limited to 'src/backend/executor')
| -rw-r--r-- | src/backend/executor/execMain.c | 1 | ||||
| -rw-r--r-- | src/backend/executor/execUtils.c | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c index bbe67ed8bba..504f4de7013 100644 --- a/src/backend/executor/execMain.c +++ b/src/backend/executor/execMain.c @@ -790,6 +790,7 @@ InitPlan(QueryDesc *queryDesc, int eflags) estate->es_tupleTable = NIL; estate->es_trig_tuple_slot = NULL; estate->es_trig_oldtup_slot = NULL; + estate->es_trig_newtup_slot = NULL; /* mark EvalPlanQual not active */ estate->es_epqTuple = NULL; diff --git a/src/backend/executor/execUtils.c b/src/backend/executor/execUtils.c index 5886c1bbd64..e76767256c0 100644 --- a/src/backend/executor/execUtils.c +++ b/src/backend/executor/execUtils.c @@ -124,6 +124,7 @@ CreateExecutorState(void) estate->es_trig_target_relations = NIL; estate->es_trig_tuple_slot = NULL; estate->es_trig_oldtup_slot = NULL; + estate->es_trig_newtup_slot = NULL; estate->es_param_list_info = NULL; estate->es_param_exec_vals = NULL; |
