aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/float.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2004-10-04 14:42:48 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2004-10-04 14:42:48 +0000
commit4171bb869f234281a13bb862d3b1e577bf336242 (patch)
treee8193f7be04ddd942f13811ef9bbe0494d24920d /src/backend/utils/adt/float.c
parent24201b4bc60e46e8de031fb5911af32bdb412d43 (diff)
downloadpostgresql-4171bb869f234281a13bb862d3b1e577bf336242.tar.gz
postgresql-4171bb869f234281a13bb862d3b1e577bf336242.zip
Detect overflow in integer arithmetic operators (integer, smallint, and
bigint variants). Clean up some inconsistencies in error message wording. Fix scanint8 to allow trailing whitespace in INT64_MIN case. Update int8-exp-three-digits.out, which seems to have been ignored by the last couple of people to modify the int8 regression test, and remove int8-exp-three-digits-win32.out which is thereby exposed as redundant.
Diffstat (limited to 'src/backend/utils/adt/float.c')
-rw-r--r--src/backend/utils/adt/float.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/backend/utils/adt/float.c b/src/backend/utils/adt/float.c
index ccee67319ce..9bb521183ab 100644
--- a/src/backend/utils/adt/float.c
+++ b/src/backend/utils/adt/float.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.110 2004/09/02 17:12:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/float.c,v 1.111 2004/10/04 14:42:46 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1147,7 +1147,7 @@ dtoi2(PG_FUNCTION_ARGS)
if ((num < SHRT_MIN) || (num > SHRT_MAX))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
- errmsg("integer out of range")));
+ errmsg("smallint out of range")));
result = (int16) rint(num);
PG_RETURN_INT16(result);
@@ -1213,7 +1213,7 @@ ftoi2(PG_FUNCTION_ARGS)
if ((num < SHRT_MIN) || (num > SHRT_MAX))
ereport(ERROR,
(errcode(ERRCODE_NUMERIC_VALUE_OUT_OF_RANGE),
- errmsg("integer out of range")));
+ errmsg("smallint out of range")));
result = (int16) rint(num);
PG_RETURN_INT16(result);