File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff 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
Original file line number Diff line number Diff line change @@ -368,6 +368,7 @@ typedef uint32 MultiXactOffset;
368368typedef uint32 CommandId ;
369369
370370#define FirstCommandId ((CommandId) 0)
371+ #define InvalidCommandId (~(CommandId)0)
371372
372373/*
373374 * Array indexing support
You can’t perform that action at this time.
0 commit comments