postgres.git / summary / log / commit / refs

commit    b63302d900767cd0fdcb13c9cc53b538f4c04b78
Author:   Heikki Linnakangas <heikki.linnakangas@iki.fi>
Date:     Mon Jan 05 09:33:35 2026 +0000
First released in: 18.2

    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


src/backend/access/heap/heapam.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/backend/access/heap/heapam.c b/src/backend/access/heap/heapam.c index 255c43da856..6203e3d7f8d 100644 --- a/src/backend/access/heap/heapam.c +++ b/src/backend/access/heap/heapam.c @@ -1062,7 +1062,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)); [parent: 789016be8ef0]