Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit b48437d

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 0b28ea7 commit b48437d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/backend/storage/page/bufpage.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -806,7 +806,7 @@ PageIndexMultiDelete(Page page, OffsetNumber *itemnos, int nitems)
806806
int nextitm;
807807
OffsetNumber offnum;
808808

809-
Assert(nitems < MaxIndexTuplesPerPage);
809+
Assert(nitems <= MaxIndexTuplesPerPage);
810810

811811
/*
812812
* If there aren't very many items to delete, then retail

0 commit comments

Comments
 (0)