Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 4bf2dfb

Browse files
committed
Quick hack to make the VXID of a prepared transaction be -1/XID,
so that different prepared xacts can be told apart in the pg_locks view. Per suggestion from Florian.
1 parent 295e639 commit 4bf2dfb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/backend/access/transam/twophase.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.33 2007/09/05 18:10:47 tgl Exp $
10+
* $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.34 2007/09/05 20:53:17 tgl Exp $
1111
*
1212
* NOTES
1313
* Each global transaction is associated with a global transaction
@@ -274,7 +274,8 @@ MarkAsPreparing(TransactionId xid, const char *gid,
274274
MemSet(&gxact->proc, 0, sizeof(PGPROC));
275275
SHMQueueElemInit(&(gxact->proc.links));
276276
gxact->proc.waitStatus = STATUS_OK;
277-
gxact->proc.lxid = InvalidLocalTransactionId;
277+
/* We set up the gxact's VXID as InvalidBackendId/XID */
278+
gxact->proc.lxid = (LocalTransactionId) xid;
278279
gxact->proc.xid = xid;
279280
gxact->proc.xmin = InvalidTransactionId;
280281
gxact->proc.pid = 0;

0 commit comments

Comments
 (0)