Content-Length: 261693 | pFad | http://github.com/postgrespro/postgres/commit/bb3ecc8c961896ecb2ad3d5ba705c2877b933945

95 amcheck: MAXALIGN() nbtree special area offset. · postgrespro/postgres@bb3ecc8 · GitHub
Skip to content

Commit bb3ecc8

Browse files
amcheck: MAXALIGN() nbtree special area offset.
This isn't strictly necessary, but in theory it might matter if in the future the width of the nbtree special area changes -- its total size might not be an even number of MAXALIGN() quantums, even with padding. PageInit() MAXALIGN()s all special area offsets, but amcheck uses the offset to perform initial basic validation of line pointers, so we don't rely on the offset from the page header. The real reason to do this is to set a good example for new code that adds amcheck coverage for other index AMs. Reported-By: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> Discussion: https://postgr.es/m/CALj2ACUMqTR9nErh99FbOBmzCXE9=gXNqhBiwYOhejJJS1LXqQ@mail.gmail.com
1 parent 82c3cd9 commit bb3ecc8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/amcheck/verify_nbtree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3134,7 +3134,7 @@ PageGetItemIdCareful(BtreeCheckState *state, BlockNumber block, Page page,
31343134
ItemId itemid = PageGetItemId(page, offset);
31353135

31363136
if (ItemIdGetOffset(itemid) + ItemIdGetLength(itemid) >
3137-
BLCKSZ - sizeof(BTPageOpaqueData))
3137+
BLCKSZ - MAXALIGN(sizeof(BTPageOpaqueData)))
31383138
ereport(ERROR,
31393139
(errcode(ERRCODE_INDEX_CORRUPTED),
31403140
errmsg("line pointer points past end of tuple space in index \"%s\"",

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/bb3ecc8c961896ecb2ad3d5ba705c2877b933945

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy