1
0
mirror of https://github.com/postgres/postgres.git synced 2026-01-26 09:41:40 +03:00

Tighten up assertion on a local variable

'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
This commit is contained in:
Heikki Linnakangas
2026-01-05 11:33:35 +02:00
parent 4c144e0452
commit 461b8cc952

View File

@@ -1077,7 +1077,7 @@ continue_page:
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));