multixact.patch
application/octet-stream
Filename: multixact.patch
Type: application/octet-stream
Part: 1
Patch
Same data as JSON:
GET /api/v1/attachments/:id/patch
the parsed metadata as JSON — format, series position, per-file stats; never the diff bytes.
API reference →
Format: unified
| File | + | − |
|---|---|---|
| src/backend/access/transam/multixact.c | 8 | 4 |
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index b7b47ef076a..18ecb9282dc 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -491,6 +491,7 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
int nmembers;
int i;
int j;
+ bool alreadyExists = false;
Assert(MultiXactIdIsValid(multi));
Assert(TransactionIdIsValid(xid));
@@ -539,8 +540,8 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
{
debug_elog4(DEBUG2, "Expand: %u is already a member of %u",
xid, multi);
- pfree(members);
- return multi;
+ alreadyExists = true;
+ break;
}
}
@@ -571,8 +572,11 @@ MultiXactIdExpand(MultiXactId multi, TransactionId xid, MultiXactStatus status)
}
}
- newMembers[j].xid = xid;
- newMembers[j++].status = status;
+ if (!alreadyExists)
+ {
+ newMembers[j].xid = xid;
+ newMembers[j++].status = status;
+ }
newMulti = MultiXactIdCreateFromMembers(j, newMembers);
pfree(members);