Still more paranoia in PageAddItem: disallow specification of an item

Tom Lane <tgl@sss.pgh.pa.us>

Commit: ba053de197eaec975e611b2969526363915e58c2
Author: Tom Lane <tgl@sss.pgh.pa.us>
Date: 2002-08-06T19:41:23Z
Releases: 7.3.1
Still more paranoia in PageAddItem: disallow specification of an item
offset past the last-used-item-plus-one, since that would result in
leaving uninitialized holes in the item pointer array.  AFAICT the only
place that was depending on this was btree index build, which was being
cavalier about when to fill in the P_HIKEY pointer; easily fixed.
Also a small performance improvement: shuffle itemid's by means of
memmove, not a one-at-a-time loop.

Files

PathChange+/−
src/backend/access/nbtree/nbtsort.c modified +8 −1
src/backend/storage/page/bufpage.c modified +28 −36