forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit984d0a1
committed
In PageIndexTupleDelete, don't assume stored item lengths are MAXALIGNed.
PageAddItem stores the item length as-is. It MAXALIGN's the amount ofspace actually allocated for each tuple, but not the stored length.PageRepairFragmentation, PageIndexMultiDelete, and PageIndexDeleteNoCompactare all on board with this and MAXALIGN item lengths after fetching them.But PageIndexTupleDelete expects the stored length to be a MAXALIGNmultiple already. This accidentally works for existing index AMs becausethey all maxalign their tuple sizes internally; but we don't do that forheap tuples, and it shouldn't be a requirement for index tuples either.So, sync PageIndexTupleDelete with the rest of bufpage.c by having itmaxalign the item size after fetching.Also add a check that pd_special is maxaligned, to ensure that the test"(offset + size) > phdr->pd_special" is still doing the right thing.(If offset and pd_special are aligned, it doesn't matter whether size is.)Again, this is in sync with the rest of the routines here, except forPageAddItem which doesn't test because it doesn't actually do anythingfor which pd_special alignment matters.This shouldn't have any immediate functional impact; it just adds theflexibility to use PageIndexTupleDelete on index tuples with non-alignedlengths.Discussion: <3814.1473366762@sss.pgh.pa.us>1 parente0013de commit984d0a1
1 file changed
+6
-2
lines changedLines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
738 | 738 |
| |
739 | 739 |
| |
740 | 740 |
| |
741 |
| - | |
| 741 | + | |
| 742 | + | |
742 | 743 |
| |
743 | 744 |
| |
744 | 745 |
| |
| |||
757 | 758 |
| |
758 | 759 |
| |
759 | 760 |
| |
760 |
| - | |
| 761 | + | |
761 | 762 |
| |
762 | 763 |
| |
763 | 764 |
| |
764 | 765 |
| |
765 | 766 |
| |
| 767 | + | |
| 768 | + | |
| 769 | + | |
766 | 770 |
| |
767 | 771 |
| |
768 | 772 |
| |
|
0 commit comments
Comments
(0)