pgsql: Fix possible corruption of AfterTriggerEventLists in - Mailing list pgsql-committers

From tgl@postgresql.org (Tom Lane)
Subject pgsql: Fix possible corruption of AfterTriggerEventLists in
Date
Msg-id 20100819154624.D20617541D7@cvs.postgresql.org
Whole thread Raw
List pgsql-committers
Log Message:
-----------
Fix possible corruption of AfterTriggerEventLists in subtransaction rollback.

afterTriggerInvokeEvents failed to adjust events->tailfree when truncating
the last chunk of an event list.  This could result in the data being
"de-truncated" by afterTriggerRestoreEventList during a subsequent
subtransaction abort.  Even that wouldn't kill us, because the re-added data
would just be events marked DONE --- unless the data had been partially
overwritten by new events.  Then we might crash, or in any case misbehave
(perhaps fire triggers twice, or fire triggers with the wrong event data).
Per bug #5622 from Thue Janus Kristensen.

Back-patch to 8.4 where the current trigger list representation was introduced.

Tags:
----
REL9_0_STABLE

Modified Files:
--------------
    pgsql/src/backend/commands:
        trigger.c (r1.262 -> r1.262.4.1)
        (http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.262&r2=1.262.4.1)

pgsql-committers by date:

Previous
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix possible corruption of AfterTriggerEventLists in
Next
From: tgl@postgresql.org (Tom Lane)
Date:
Subject: pgsql: Fix possible corruption of AfterTriggerEventLists in