pgsql: Fix possible corruption of AfterTriggerEventLists in

From: tgl(at)postgresql(dot)org (Tom Lane)
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible corruption of AfterTriggerEventLists in
Date: 2010-08-19 15:46:30
Message-ID: 20100819154630.BF2937541D7@cvs.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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:
----
REL8_4_STABLE

Modified Files:
--------------
pgsql/src/backend/commands:
trigger.c (r1.248.2.2 -> r1.248.2.3)
(http://anoncvs.postgresql.org/cvsweb.cgi/pgsql/src/backend/commands/trigger.c?r1=1.248.2.2&r2=1.248.2.3)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2010-08-19 16:16:20 pgsql: Allocate local buffers in a context of their own, rather than
Previous Message Tom Lane 2010-08-19 15:46:24 pgsql: Fix possible corruption of AfterTriggerEventLists in