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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix trigger WHEN conditions when both BEFORE and AFTER triggers
Date: 2011-08-21 22:16:40
Message-ID: E1QvGJs-0002oW-Us@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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
------
REL9_1_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/38c9eb8fee298a9242bb2049c4fdf94407187d0c

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 | 8 +++++++-
src/test/regress/expected/triggers.out | 29 +++++++++++++++++++++++++++++
src/test/regress/sql/triggers.sql | 26 ++++++++++++++++++++++++++
6 files changed, 67 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Bruce Momjian 2011-08-22 01:24:32 pgsql: Simplify errno generating in thread testing program.
Previous Message Bruce Momjian 2011-08-20 22:22:30 pgsql: Have thread_test create its test files in the current directory,