Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit71901ab

Browse files
committed
Introduce InvalidCommandId.
This allows a 32-bit field to represent an *optional* command IDwithout a separate flag bit.Andres Freund
1 parent9c68834 commit71901ab

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
typedefuint32CommandId;
369369

370370
#defineFirstCommandId((CommandId) 0)
371+
#defineInvalidCommandId(~(CommandId)0)
371372

372373
/*
373374
* Array indexing support

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp