Avoid overflow computing visibility map length Computing the number of visibility map blocks used addition-based ceiling division on a BlockNumber. For heap lengths near MaxBlockNumber on 32-bit builds, the addition could overflow and produce a much smaller visibility map length, potentially zero.
Use quotient and remainder instead so the calculation cannot overflow. Reported-by: Melanie Plageman <[email protected]> Author: Melanie Plageman <[email protected]> Reviewed-by: shihao zhong <[email protected]> Backpatch-through: 17 Branch ------ REL_19_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/e91c07e28348fb33d7acee7922c889dd7e205394 Modified Files -------------- src/backend/access/heap/visibilitymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
