summaryrefslogtreecommitdiff
path: root/src/backend/access/transam/multixact.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/access/transam/multixact.c')
-rw-r--r--src/backend/access/transam/multixact.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/backend/access/transam/multixact.c b/src/backend/access/transam/multixact.c
index 27f02faec80..8ed3fd9d071 100644
--- a/src/backend/access/transam/multixact.c
+++ b/src/backend/access/transam/multixact.c
@@ -909,6 +909,7 @@ RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset,
int64 next_pageno;
int next_entryno;
MultiXactOffset *next_offptr;
+ MultiXactOffset next_offset;
LWLock *lock;
LWLock *prevlock = NULL;
@@ -976,11 +977,15 @@ RecordNewMultiXact(MultiXactId multi, MultiXactOffset offset,
next_offptr += next_entryno;
}
- if (*next_offptr != offset + nmembers)
+ /* Like in GetNewMultiXactId(), skip over offset 0 */
+ next_offset = offset + nmembers;
+ if (next_offset == 0)
+ next_offset = 1;
+ if (*next_offptr != next_offset)
{
/* should already be set to the correct value, or not at all */
Assert(*next_offptr == 0);
- *next_offptr = offset + nmembers;
+ *next_offptr = next_offset;
MultiXactOffsetCtl->shared->page_dirty[slotno] = true;
}