Skip to content

Commit 8feee4e

Browse files
committed
Avoid zero offset in GetNewMultiXactId
1 parent b9e2150 commit 8feee4e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/backend/access/transam/multixact.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -961,7 +961,13 @@ GetNewMultiXactId(int nmembers, MultiXactOffset *offset)
961961
* GetMultiXactIdMembers() for motivation.
962962
*/
963963
nextOffset = MultiXactState->nextOffset;
964-
*offset = nextOffset;
964+
if (nextOffset == 0)
965+
{
966+
*offset = 1;
967+
nmembers++; /* allocate member slot 0 too */
968+
}
969+
else
970+
*offset = nextOffset;
965971

966972
ExtendMultiXactMember(nextOffset, nmembers);
967973

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy