Quick hack to make the VXID of a prepared transaction be -1/XID,
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Sep 2007 20:53:17 +0000 (20:53 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 5 Sep 2007 20:53:17 +0000 (20:53 +0000)
so that different prepared xacts can be told apart in the pg_locks
view.  Per suggestion from Florian.

src/backend/access/transam/twophase.c

index 7196cee79a0c259d10f6bcd67f04391776e9c3e5..2826bf69f2fd246aa7f383c7992b8d93ed55dc7f 100644 (file)
@@ -274,7 +274,8 @@ MarkAsPreparing(TransactionId xid, const char *gid,
        MemSet(&gxact->proc, 0, sizeof(PGPROC));
        SHMQueueElemInit(&(gxact->proc.links));
        gxact->proc.waitStatus = STATUS_OK;
-       gxact->proc.lxid = InvalidLocalTransactionId;
+       /* We set up the gxact's VXID as InvalidBackendId/XID */
+       gxact->proc.lxid = (LocalTransactionId) xid;
        gxact->proc.xid = xid;
        gxact->proc.xmin = InvalidTransactionId;
        gxact->proc.pid = 0;