Fix return value of visibilitymap_get_status().
authorNathan Bossart <nathan@postgresql.org>
Thu, 24 Jul 2025 15:13:45 +0000 (10:13 -0500)
committerNathan Bossart <nathan@postgresql.org>
Thu, 24 Jul 2025 15:13:45 +0000 (10:13 -0500)
This function is declared as returning a uint8, but it returns a
bool in one code path.  To fix, return (uint8) 0 instead of false
there.  This should behave exactly the same as before, but it might
prevent future compiler complaints.

Oversight in commit a892234f83.

Author: Julien Rouhaud <rjuju123@gmail.com>
Discussion: http://postgr.es/m/aIHluT2isN58jqHV%40jrouhaud

src/backend/access/heap/visibilitymap.c

index 745a04ef26e291d9badfa2d05be97821cc65793f..8f918e00af7edc7b1a9964d046ff32c1251231e9 100644 (file)
@@ -364,7 +364,7 @@ visibilitymap_get_status(Relation rel, BlockNumber heapBlk, Buffer *vmbuf)
    {
        *vmbuf = vm_readbuf(rel, mapBlock, false);
        if (!BufferIsValid(*vmbuf))
-           return false;
+           return (uint8) 0;
    }
 
    map = PageGetContents(BufferGetPage(*vmbuf));