Skip to content

Commit 9598afa

Browse files
committed
Fix one overflow and one signedness error, caused by the patch to calculate
OLDSERXID_MAX_PAGE based on BLCKSZ. MSVC compiler warned about these.
1 parent 7544064 commit 9598afa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/backend/storage/lmgr/predicate.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ static SlruCtlData OldSerXidSlruCtlData;
311311
* transactions and the maximum that SLRU supports.
312312
*/
313313
#define OLDSERXID_MAX_PAGE Min(SLRU_PAGES_PER_SEGMENT * 0x10000 - 1, \
314-
(MaxTransactionId + 1) / OLDSERXID_ENTRIESPERPAGE - 1)
314+
(MaxTransactionId) / OLDSERXID_ENTRIESPERPAGE)
315315

316316
#define OldSerXidNextPage(page) (((page) >= OLDSERXID_MAX_PAGE) ? 0 : (page) + 1)
317317

@@ -767,7 +767,7 @@ OldSerXidPagePrecedesLogically(int p, int q)
767767
diff = p - q;
768768
if (diff >= ((OLDSERXID_MAX_PAGE + 1) / 2))
769769
diff -= OLDSERXID_MAX_PAGE + 1;
770-
else if (diff < -((OLDSERXID_MAX_PAGE + 1) / 2))
770+
else if (diff < -((int) (OLDSERXID_MAX_PAGE + 1) / 2))
771771
diff += OLDSERXID_MAX_PAGE + 1;
772772
return diff < 0;
773773
}

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