aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-07 18:14:25 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-07 18:14:25 +0000
commit4cd4ed0cc29001b019d6ae873d18bc09ab72cf64 (patch)
tree15fd97a7ec7ca6c6276d7bc3b6ea653afeb1027f /src
parent8a9e32912e4b0d1702fe3760f3e5889ee51f1f13 (diff)
downloadpostgresql-4cd4ed0cc29001b019d6ae873d18bc09ab72cf64.tar.gz
postgresql-4cd4ed0cc29001b019d6ae873d18bc09ab72cf64.zip
Fix case in which a debug printout would print already-pfreed data.
Diffstat (limited to 'src')
-rw-r--r--src/backend/access/transam/multixact.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 628107634b8..44c9541209e 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -31,7 +31,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.2 2005/05/03 19:42:40 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/access/transam/multixact.c,v 1.3 2005/05/07 18:14:25 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -310,9 +310,9 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid)
{
if (TransactionIdEquals(members[i], xid))
{
- pfree(members);
debug_elog4(DEBUG2, "Expand: %u is already a member of %u",
xid, multi);
+ pfree(members);
return multi;
}
}
@@ -376,8 +376,8 @@ MultiXactIdIsRunning(MultiXactId multi)
{
if (TransactionIdEquals(members[i], myXid))
{
- pfree(members);
debug_elog3(DEBUG2, "IsRunning: I (%d) am running!", i);
+ pfree(members);
return true;
}
}
@@ -391,14 +391,15 @@ MultiXactIdIsRunning(MultiXactId multi)
{
if (TransactionIdIsInProgress(members[i]))
{
- pfree(members);
debug_elog4(DEBUG2, "IsRunning: member %d (%u) is running",
- i, members[i]);
+ i, members[i]);
+ pfree(members);
return true;
}
}
pfree(members);
+
debug_elog3(DEBUG2, "IsRunning: %u is not running", multi);
return false;
@@ -646,6 +647,7 @@ CreateMultiXactId(int nxids, TransactionId *xids)
/* Store the new MultiXactId in the local cache, too */
mXactCachePut(multi, nxids, xids);
+
debug_elog2(DEBUG2, "Create: all done");
return multi;