pgsql: Add overflow checks to money type input function

From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Add overflow checks to money type input function
Date: 2016-09-15 02:27:59
Message-ID: E1bkMP9-0007Hr-3g@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Add overflow checks to money type input function

The money type input function did not have any overflow checks at all.
There were some regression tests that purported to check for overflow,
but they actually checked for the overflow behavior of the int8 type
before casting to money. Remove those unnecessary checks and add some
that actually check the money input function.

Reviewed-by: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/656df624c0d7b50e1714f2a3a14e143e63799a80

Modified Files
--------------
src/backend/utils/adt/cash.c | 53 ++++++++++++++++++--
src/test/regress/expected/money.out | 98 ++++++++++++++++++++++++++++++++++---
src/test/regress/sql/money.sql | 30 ++++++++++--
3 files changed, 165 insertions(+), 16 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2016-09-15 08:53:20 pgsql: Fix and clarify comments on replacement selection.
Previous Message Tom Lane 2016-09-14 23:49:05 pgsql: Tweak targetlist-SRF tests some more.