Fix assorted core dumps and Assert failures that could occur during

Tom Lane <tgl@sss.pgh.pa.us>

Commit: 5244ed40cfc9a6234d2d291f61884e80f8330d03
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2010-01-24T21:49:31Z
Releases: 8.4.3
Fix assorted core dumps and Assert failures that could occur during
AbortTransaction or AbortSubTransaction, when trying to clean up after an
error that prevented (sub)transaction start from completing:
* access to TopTransactionResourceOwner that might not exist
* assert failure in AtEOXact_GUC, if AtStart_GUC not called yet
* assert failure or core dump in AfterTriggerEndSubXact, if
  AfterTriggerBeginSubXact not called yet

Per testing by injecting elog(ERROR) at successive steps in StartTransaction
and StartSubTransaction.  It's not clear whether all of these cases could
really occur in the field, but at least one of them is easily exposed by
simple stress testing, as per my accidental discovery yesterday.

Files

PathChange+/−
src/backend/access/transam/xact.c modified +33 −30
src/backend/commands/trigger.c modified +12 −5
src/backend/utils/misc/guc.c modified +9 −2