Fix nbtree high key "continuescan" row compare bug.
Peter Geoghegan <pg@bowt.ie>
Fix nbtree high key "continuescan" row compare bug. Commit 29b64d1d mishandled skipping over truncated high key attributes during row comparisons. The row comparison key matching loop would loop forever when a truncated attribute was encountered for a row compare subkey. Fix by following the example of other code in the loop: advance the current subkey, or break out of the loop when the last subkey is reached. Add test coverage for the relevant _bt_check_rowcompare() code path. The new test case is somewhat tied to nbtree implementation details, which isn't ideal, but seems unavoidable.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/nbtree/nbtutils.c | modified | +3 −0 |
| src/test/regress/expected/index_including.out | modified | +20 −1 |
| src/test/regress/sql/index_including.sql | modified | +7 −1 |