pgsql: Fix division by zero in _bt_vacuum_needs_cleanup()

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

pgsql: Fix division by zero in _bt_vacuum_needs_cleanup()

Alexander Korotkov-3
Fix division by zero in _bt_vacuum_needs_cleanup()

Checks inside _bt_vacuum_needs_cleanup() allow division by zero to happen when
metad->btm_last_cleanup_num_heap_tuples == 0.  This commit adjusts the
expression so that no division by zero might happen.

Reported-by: Piotr Stefaniak
Reviewed-by: Masahiko Sawada
Backpatch-through: 11



Modified Files
src/backend/access/nbtree/nbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)