aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2007-09-05 20:53:17 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2007-09-05 20:53:17 +0000
commit4bf2dfb9a26a9d6f97b8d54e939d2bf02c4d99a1 (patch)
tree06c22ad9557bd24de8182ba2c9f3c0acd72d5f79
parent295e63983d7596ccc5717ff4a0a235ba241a2614 (diff)
downloadpostgresql-4bf2dfb9a26a9d6f97b8d54e939d2bf02c4d99a1.tar.gz
postgresql-4bf2dfb9a26a9d6f97b8d54e939d2bf02c4d99a1.zip
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.
-rw-r--r--src/backend/access/transam/twophase.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/backend/access/transam/twophase.c b/src/backend/access/transam/twophase.c
index 3e7e8435029..db47e95cf84 100644
--- a/src/backend/access/transam/twophase.c
+++ b/src/backend/access/transam/twophase.c
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.33 2007/09/05 18:10:47 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/twophase.c,v 1.34 2007/09/05 20:53:17 tgl Exp $
*
* NOTES
* Each global transaction is associated with a global transaction
@@ -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;