pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dean Rasheed <dean.a.rasheed@gmail.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Fix numeric_mul() overflow due to too many digits after decimal
Date: Sat, 10 Jul 2021 11:54:15 +0000
Message-ID: <E1m2BYl-0007cV-D1@gemulon.postgresql.org> (raw)

Fix numeric_mul() overflow due to too many digits after decimal point.

This fixes an overflow error when using the numeric * operator if the
result has more than 16383 digits after the decimal point by rounding
the result. Overflow errors should only occur if the result has too
many digits *before* the decimal point.

Discussion: https://postgr.es/m/CAEZATCUmeFWCrq2dNzZpRj5+6LfN85jYiDoqm+ucSXhb9U2TbA@mail.gmail.com

Branch
------
REL9_6_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/f8abf6944b12c9ed01062a5163385f6c49f0f6ef

Modified Files
--------------
src/backend/utils/adt/numeric.c       | 10 +++++++++-
src/test/regress/expected/numeric.out |  6 ++++++
src/test/regress/sql/numeric.sql      |  2 ++
3 files changed, 17 insertions(+), 1 deletion(-)



view thread (11+ messages)  latest in thread

Message-ID: <E1m2BYl-0007cV-D1@gemulon.postgresql.org>
Permalink:  ../E1m2BYl-0007cV-D1@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1m2BYl-0007cV-D1@gemulon.postgresql.org

 · 

reply

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: dean.a.rasheed@gmail.com
  Subject: Re: pgsql: Fix numeric_mul() overflow due to too many digits after decimal
  In-Reply-To: <E1m2BYl-0007cV-D1@gemulon.postgresql.org>
  References: <E1m2BYl-0007cV-D1@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