postgres.git / summary / log / commit / refs

commit    a37e5745453f76e4bec208920773ef9c90fd50d1
Author:   Melanie Plageman <melanieplageman@gmail.com>
Date:     Tue Aug 04 22:04:28 2026 +0000

    Silence Coverity warning about unused visibilitymap_clear() result
    
    Commit c0d9864f5ce made all but one caller of visibilitymap_clear() check
    its return value, causing Coverity to flag the remaining unchecked call
    in heap_page_fix_vm_corruption().
    
    This VM clear is not WAL-logged, so the caller doesn't need the return
    value of visibilitymap_clear(). Add an explicit void cast and comment to
    document that the return value is intentionally ignored.
    
    Backpatch to 19 when the number of callers discarding the return value
    dropped low enough to trigger Coverity's warning.
    
    Discussion: https://postgr.es/m/1065814.1784514869%40sss.pgh.pa.us
    Reported-by: Tom Lane <tgl@sss.pgh.pa.us>
    Backpatch-through: 19


src/backend/access/heap/pruneheap.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/backend/access/heap/pruneheap.c b/src/backend/access/heap/pruneheap.c index b146119d7af..29f4722b02d 100644 --- a/src/backend/access/heap/pruneheap.c +++ b/src/backend/access/heap/pruneheap.c @@ -948,9 +948,10 @@ heap_page_fix_vm_corruption(PruneState *prstate, OffsetNumber offnum, if (do_clear_vm) { LockBuffer(prstate->vmbuffer, BUFFER_LOCK_EXCLUSIVE); - visibilitymap_clear(prstate->relation->rd_locator, prstate->block, - prstate->vmbuffer, - VISIBILITYMAP_VALID_BITS); + /* This VM clear is not WAL-logged, so its return value is not needed. */ + (void) visibilitymap_clear(prstate->relation->rd_locator, + prstate->block, prstate->vmbuffer, + VISIBILITYMAP_VALID_BITS); LockBuffer(prstate->vmbuffer, BUFFER_LOCK_UNLOCK); prstate->old_vmbits = 0; } [parent: 18992dc9d980]