Skip to content

Commit b3288a6

Browse files
committed
Fix off-by-one error in Assertion.
The point of the assertion is to ensure that the arrays allocated in stack are large enough, but the check was one item short. This won't matter in practice because MaxIndexTuplesPerPage is an overestimate, so you can't have that many items on a page in reality. But let's be tidy. Spotted by Anastasia Lubennikova. Backpatch to all supported versions, like the patch that added the assertion.
1 parent 8c479a8 commit b3288a6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/page/bufpage.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -778,7 +778,7 @@ PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
778778
int nextitm;
779779
OffsetNumber offnum;
780780

781-
Assert(nitems < MaxIndexTuplesPerPage);
781+
Assert(nitems <= MaxIndexTuplesPerPage);
782782

783783
/*
784784
* If there aren't very many items to delete, then retail

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