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 ------ master Details ------- https://git.postgresql.org/pg/commitdiff/0bfb84006e3ef2f6826e91e374b5379cc4d4a481 Modified Files -------------- src/backend/access/heap/visibilitymap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
