🌐 AI搜索 & 代理 主页
Skip to content

Commit 366dcda

Browse files
committed
Clarify comment on multixid offset wraparound check
Coverity complained that offset cannot be 0 here because there's an explicit check for "offset == 0" earlier in the function, but it didn't see the possibility that offset could've wrapped around to 0. The code is correct, but clarify the comment about it. The same code exists in backbranches in the server GetMultiXactIdMembers() function and in 'master' in the pg_upgrade GetOldMultiXactIdSingleMember function. In backbranches Coverity didn't complain about it because the check was merely an assertion, but change the comment in all supported branches for consistency. Per Tom Lane's suggestion. Discussion: https://www.postgresql.org/message-id/1827755.1765752936@sss.pgh.pa.us
1 parent cd83ed9 commit 366dcda

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/pg_upgrade/multixact_read_v18.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,8 @@ GetOldMultiXactIdSingleMember(OldMultiXactReader *state, MultiXactId multi,
276276
if (!TransactionIdIsValid(*xactptr))
277277
{
278278
/*
279-
* Corner case 2: we are looking at unused slot zero
279+
* Corner case 2: offset must have wrapped around to unused slot
280+
* zero.
280281
*/
281282
if (offset == 0)
282283
continue;

0 commit comments

Comments
 (0)