summaryrefslogtreecommitdiff
path: root/src/test/regress/expected/float4-exp-three-digits.out
diff options
context:
space:
mode:
authorBruce Momjian <bruce@momjian.us>2007-01-02 20:00:50 +0000
committerBruce Momjian <bruce@momjian.us>2007-01-02 20:00:50 +0000
commitf9ac414c35ea084ff70c564ab2c32adb06d5296f (patch)
treecec15aa55c29cbf431576e87ba2e950e0226549b /src/test/regress/expected/float4-exp-three-digits.out
parent0b56be83441c01419fcf82ebe666e968e6f7b246 (diff)
downloadpostgresql-f9ac414c35ea084ff70c564ab2c32adb06d5296f.tar.gz
Fix float4/8 to handle Infinity and Nan consistently, e.g. Infinity is a
valid result from a computation if one of the input values was infinity. The previous code assumed an operation that returned infinity was an overflow. Handle underflow/overflow consistently, and add checks for aggregate overflow. Consistently prevent Inf/Nan from being cast to integer data types. Fix INT_MIN % -1 to prevent overflow. Update regression results for new error text. Per report from Roman Kononov.
Diffstat (limited to 'src/test/regress/expected/float4-exp-three-digits.out')
-rw-r--r--src/test/regress/expected/float4-exp-three-digits.out22
1 files changed, 13 insertions, 9 deletions
diff --git a/src/test/regress/expected/float4-exp-three-digits.out b/src/test/regress/expected/float4-exp-three-digits.out
index a696a6d1c5..fd8d0b319e 100644
--- a/src/test/regress/expected/float4-exp-three-digits.out
+++ b/src/test/regress/expected/float4-exp-three-digits.out
@@ -8,14 +8,14 @@ INSERT INTO FLOAT4_TBL(f1) VALUES (' -34.84 ');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e+20');
INSERT INTO FLOAT4_TBL(f1) VALUES ('1.2345678901234e-20');
-- test for over and under flow
-INSERT INTO FLOAT4_TBL(f1) VALUES ('10e40');
-ERROR: type "real" value out of range: overflow
-INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e40');
-ERROR: type "real" value out of range: overflow
-INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
-ERROR: type "real" value out of range: underflow
-INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
-ERROR: type "real" value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e70');
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e70');
+ERROR: value out of range: overflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-70');
+ERROR: value out of range: underflow
+INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-70');
+ERROR: value out of range: underflow
-- bad input
INSERT INTO FLOAT4_TBL(f1) VALUES ('');
ERROR: invalid input syntax for type real: ""
@@ -72,7 +72,11 @@ ERROR: invalid input syntax for type real: "NaN x"
SELECT ' INFINITY x'::float4;
ERROR: invalid input syntax for type real: " INFINITY x"
SELECT 'Infinity'::float4 + 100.0;
-ERROR: type "double precision" value out of range: overflow
+ ?column?
+----------
+ Infinity
+(1 row)
+
SELECT 'Infinity'::float4 / 'Infinity'::float4;
?column?
----------