pgsql: Fix nbtree lookahead overflow bug.

2024-08-26 Thread Peter Geoghegan
Fix nbtree lookahead overflow bug. Add bounds checking to nbtree's lookahead/skip-within-a-page mechanism. Otherwise it's possible for cases with lots of before-array-keys tuples to overflow an int16 variable, causing the mechanism to generate an out of bounds page offset number. Oversight in com

pgsql: Fix nbtree lookahead overflow bug.

2024-08-26 Thread Peter Geoghegan
Fix nbtree lookahead overflow bug. Add bounds checking to nbtree's lookahead/skip-within-a-page mechanism. Otherwise it's possible for cases with lots of before-array-keys tuples to overflow an int16 variable, causing the mechanism to generate an out of bounds page offset number. Oversight in com