diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-21 18:16:02 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2011-08-21 18:16:02 -0400 |
commit | 38c9eb8fee298a9242bb2049c4fdf94407187d0c (patch) | |
tree | e403c803a48bf184cf83bb36db2d9c82fc469a7b /src/include/nodes/execnodes.h | |
parent | 548d1f752be7a11e240f1eadd4f9987a7b9793c5 (diff) | |
download | postgresql-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/include/nodes/execnodes.h')
-rw-r--r-- | src/include/nodes/execnodes.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 16756616e52..187c70a0e01 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -354,7 +354,7 @@ typedef struct EState /* Stuff used for firing triggers: */ List *es_trig_target_relations; /* trigger-only ResultRelInfos */ TupleTableSlot *es_trig_tuple_slot; /* for trigger output tuples */ - TupleTableSlot *es_trig_oldtup_slot; /* for trigger old tuples */ + TupleTableSlot *es_trig_oldtup_slot; /* for TriggerEnabled */ /* Parameter info: */ ParamListInfo es_param_list_info; /* values of external params */ @@ -401,6 +401,12 @@ typedef struct EState HeapTuple *es_epqTuple; /* array of EPQ substitute tuples */ bool *es_epqTupleSet; /* true if EPQ tuple is provided */ bool *es_epqScanDone; /* true if EPQ tuple has been fetched */ + + /* + * this field added at end of struct to avoid post-release ABI breakage in + * existing release branches. It'll be in a more logical place in 9.2. + */ + TupleTableSlot *es_trig_newtup_slot; /* for TriggerEnabled */ } EState; |