pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Nathan Bossart <nathan@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Add overflow checks to money type.
Date: Fri, 19 Jul 2024 16:55:33 +0000
Message-ID: <E1sUqtJ-000I11-WB@gemulon.postgresql.org> (raw)

Add overflow checks to money type.

None of the arithmetic functions for the the money type handle
overflow.  This commit introduces several helper functions with
overflow checking and makes use of them in the money type's
arithmetic functions.

Fixes bug #18240.

Reported-by: Alexander Lakhin
Author: Joseph Koshakow
Discussion: https://postgr.es/m/18240-c5da758d7dc1ecf0%40postgresql.org
Discussion: https://postgr.es/m/CAAvxfHdBPOyEGS7s%2Bxf4iaW0-cgiq25jpYdWBqQqvLtLe_t6tw%40mail.gmail.com
Backpatch-through: 12

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/utils/adt/cash.c        | 174 +++++++++++++++++++-----------------
src/test/regress/expected/money.out |  19 ++++
src/test/regress/sql/money.sql      |  11 +++
3 files changed, 124 insertions(+), 80 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1sUqtJ-000I11-WB@gemulon.postgresql.org>
Permalink:  ../E1sUqtJ-000I11-WB@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1sUqtJ-000I11-WB@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 using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: nathan@postgresql.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Add overflow checks to money type.
  In-Reply-To: <E1sUqtJ-000I11-WB@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