diff options
| author | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-12-15 11:47:04 +0200 |
|---|---|---|
| committer | Heikki Linnakangas <heikki.linnakangas@iki.fi> | 2025-12-15 11:47:04 +0200 |
| commit | 366dcdaf5779792f522d1d18a8e558244850afdf (patch) | |
| tree | 2b7a2acaab1a49b94fe477bd8dcfc99640741400 /src/bin | |
| parent | cd83ed9a91bbd4d05fffd059161b060b7473f5ad (diff) | |
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
Diffstat (limited to 'src/bin')
| -rw-r--r-- | src/bin/pg_upgrade/multixact_read_v18.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/pg_upgrade/multixact_read_v18.c b/src/bin/pg_upgrade/multixact_read_v18.c index f74011c4786..f7ed97f702b 100644 --- a/src/bin/pg_upgrade/multixact_read_v18.c +++ b/src/bin/pg_upgrade/multixact_read_v18.c @@ -276,7 +276,8 @@ GetOldMultiXactIdSingleMember(OldMultiXactReader *state, MultiXactId multi, if (!TransactionIdIsValid(*xactptr)) { /* - * Corner case 2: we are looking at unused slot zero + * Corner case 2: offset must have wrapped around to unused slot + * zero. */ if (offset == 0) continue; |
