Обсуждение: pgsql: Fix trigger WHEN conditions when both BEFORE and AFTER triggers

Поиск
Список
Период
Сортировка

pgsql: Fix trigger WHEN conditions when both BEFORE and AFTER triggers

От
Tom Lane
Дата:
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.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/b33f78df17c32364d51f6e5128f8d81d7d3013a2

Modified Files
--------------
src/backend/commands/trigger.c         |    6 +++---
src/backend/executor/execMain.c        |    1 +
src/backend/executor/execUtils.c       |    1 +
src/include/nodes/execnodes.h          |    3 ++-
src/test/regress/expected/triggers.out |   29 +++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql      |   26 ++++++++++++++++++++++++++
6 files changed, 62 insertions(+), 4 deletions(-)