Fix TwoPhaseGetDummyBackendId().
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2012 15:52:02 +0000 (11:52 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 8 Aug 2012 15:52:02 +0000 (11:52 -0400)
commitdb108349bf7fe7fe82e2ff32e42436cfbc4f37dc
tree16969ff44a50288ce8d9fc48a69454cd1239aca3
parent5ebaaa49445eb1ba7b299bbea3a477d4e4c0430b
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.
src/backend/access/transam/twophase.c