Skip to content

Commit 71901ab

Browse files
committed
Introduce InvalidCommandId.
This allows a 32-bit field to represent an *optional* command ID without a separate flag bit. Andres Freund
1 parent 9c68834 commit 71901ab

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

src/backend/access/transam/xact.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -766,12 +766,12 @@ CommandCounterIncrement(void)
766766
if (currentCommandIdUsed)
767767
{
768768
currentCommandId += 1;
769-
if (currentCommandId == FirstCommandId) /* check for overflow */
769+
if (currentCommandId == InvalidCommandId)
770770
{
771771
currentCommandId -= 1;
772772
ereport(ERROR,
773773
(errcode(ERRCODE_PROGRAM_LIMIT_EXCEEDED),
774-
errmsg("cannot have more than 2^32-1 commands in a transaction")));
774+
errmsg("cannot have more than 2^32-2 commands in a transaction")));
775775
}
776776
currentCommandIdUsed = false;
777777

src/include/c.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -368,6 +368,7 @@ typedef uint32 MultiXactOffset;
368368
typedef uint32 CommandId;
369369

370370
#define FirstCommandId ((CommandId) 0)
371+
#define InvalidCommandId (~(CommandId)0)
371372

372373
/*
373374
* Array indexing support

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