Still more paranoia in PageAddItem: disallow specification of an item
Tom Lane <tgl@sss.pgh.pa.us>
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
| Path | Change | +/− |
|---|---|---|
| src/backend/access/nbtree/nbtsort.c | modified | +8 −1 |
| src/backend/storage/page/bufpage.c | modified | +28 −36 |