]> granicus.if.org Git - postgresql/commit
Fix trigger WHEN conditions when both BEFORE and AFTER triggers exist.
authorTom Lane <tgl@sss.pgh.pa.us>
Sun, 21 Aug 2011 22:16:02 +0000 (18:16 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sun, 21 Aug 2011 22:16:02 +0000 (18:16 -0400)
commit38c9eb8fee298a9242bb2049c4fdf94407187d0c
treee403c803a48bf184cf83bb36db2d9c82fc469a7b
parent548d1f752be7a11e240f1eadd4f9987a7b9793c5
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.
src/backend/commands/trigger.c
src/backend/executor/execMain.c
src/backend/executor/execUtils.c
src/include/nodes/execnodes.h
src/test/regress/expected/triggers.out
src/test/regress/sql/triggers.sql