'lineindex' is 0-based, as mentioned in the comments.
Backpatch to v18 where the assertion was added.
Author: ChangAo Chen <
cca5507@qq.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Discussion: https://www.postgresql.org/message-id/tencent_A84F3C810365BB9BD08442955AE494141907@qq.com
Backpatch-through: 18
ItemId lpp;
OffsetNumber lineoff;
- Assert(lineindex <= scan->rs_ntuples);
+ Assert(lineindex < scan->rs_ntuples);
lineoff = scan->rs_vistuples[lineindex];
lpp = PageGetItemId(page, lineoff);
Assert(ItemIdIsNormal(lpp));