aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/execMain.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2011-08-21 18:16:02 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2011-08-21 18:16:02 -0400
commit38c9eb8fee298a9242bb2049c4fdf94407187d0c (patch)
treee403c803a48bf184cf83bb36db2d9c82fc469a7b /src/backend/executor/execMain.c
parent548d1f752be7a11e240f1eadd4f9987a7b9793c5 (diff)
downloadpostgresql-38c9eb8fee298a9242bb2049c4fdf94407187d0c.tar.gz
postgresql-38c9eb8fee298a9242bb2049c4fdf94407187d0c.zip
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/execMain.c')
-rw-r--r--src/backend/executor/execMain.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/backend/executor/execMain.c b/src/backend/executor/execMain.c
index 1d92f5980b4..4c05c80b272 100644
--- a/src/backend/executor/execMain.c
+++ b/src/backend/executor/execMain.c
@@ -871,6 +871,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;