From: Alexander Korotkov <akorotkov@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix division by zero in _bt_vacuum_needs_cleanup()
Date: Mon, 15 Apr 2019 18:56:58 +0000
Message-ID: <E1hG6mo-0006WI-8j@gemulon.postgresql.org> (raw)
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
Discussion: https://postgr.es/m/DB8PR03MB5931C41F7787A95313F08322F22A0%40DB8PR03MB5931.eurprd03.prod.outlook.com
Reviewed-by: Masahiko Sawada
Backpatch-through: 11
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/1e871981823a68ec9e0174b652e8d27e05ce08bb
Modified Files
--------------
src/backend/access/nbtree/nbtree.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: akorotkov@postgresql.org
Subject: Re: pgsql: Fix division by zero in _bt_vacuum_needs_cleanup()
In-Reply-To: <E1hG6mo-0006WI-8j@gemulon.postgresql.org>
References: <E1hG6mo-0006WI-8j@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox