Fix TwoPhaseGetDummyBackendId().

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

Commit: 5cf2307c98f6daeac3d42e74f4e2d46ab3bf0a80
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2012-08-08T15:52:06Z
Releases: 9.2.0
Fix TwoPhaseGetDummyBackendId().

This was broken in commit ed0b409d22346b1b027a4c2099ca66984d94b6dd,
which revised the GlobalTransactionData struct to not include the
associated PGPROC as its first member, but overlooked one place where
a cast was used in reliance on that equivalence.

The most effective way of fixing this seems to be to create a new function
that looks up the GlobalTransactionData struct given the XID, and make
both TwoPhaseGetDummyBackendId and TwoPhaseGetDummyProc rely on that.

Per report from Robert Ross.

Files

PathChange+/−
src/backend/access/transam/twophase.c modified +46 −30