Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf744c0f

Browse files
committed
float8-small-is-zero and float8-exp-three-digits will likely need
similar changes.Claudio Natoli
1 parent3947f65 commitf744c0f

File tree

3 files changed

+144
-0
lines changed

3 files changed

+144
-0
lines changed

‎src/test/regress/expected/float4-exp-three-digits.out

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,73 @@ INSERT INTO FLOAT4_TBL(f1) VALUES ('10e-40');
1616
ERROR: type "real" value out of range: underflow
1717
INSERT INTO FLOAT4_TBL(f1) VALUES ('-10e-40');
1818
ERROR: type "real" value out of range: underflow
19+
-- bad input
20+
INSERT INTO FLOAT4_TBL(f1) VALUES (' ');
21+
ERROR: invalid input syntax for type real: " "
22+
INSERT INTO FLOAT4_TBL(f1) VALUES ('xyz');
23+
ERROR: invalid input syntax for type real: "xyz"
24+
INSERT INTO FLOAT4_TBL(f1) VALUES ('5.0.0');
25+
ERROR: invalid input syntax for type real: "5.0.0"
26+
INSERT INTO FLOAT4_TBL(f1) VALUES ('5 . 0');
27+
ERROR: invalid input syntax for type real: "5 . 0"
28+
INSERT INTO FLOAT4_TBL(f1) VALUES ('5. 0');
29+
ERROR: invalid input syntax for type real: "5. 0"
30+
INSERT INTO FLOAT4_TBL(f1) VALUES (' - 3.0');
31+
ERROR: invalid input syntax for type real: " - 3.0"
32+
INSERT INTO FLOAT4_TBL(f1) VALUES ('123 5');
33+
ERROR: invalid input syntax for type real: "123 5"
34+
-- special inputs
35+
SELECT 'NaN'::float4;
36+
float4
37+
--------
38+
NaN
39+
(1 row)
40+
41+
SELECT 'nan'::float4;
42+
float4
43+
--------
44+
NaN
45+
(1 row)
46+
47+
SELECT ' NAN '::float4;
48+
float4
49+
--------
50+
NaN
51+
(1 row)
52+
53+
SELECT 'infinity'::float4;
54+
float4
55+
----------
56+
Infinity
57+
(1 row)
58+
59+
SELECT ' -INFINiTY '::float4;
60+
float4
61+
-----------
62+
-Infinity
63+
(1 row)
64+
65+
-- bad special inputs
66+
SELECT 'N A N'::float4;
67+
ERROR: invalid input syntax for type real: "N A N"
68+
SELECT 'NaN x'::float4;
69+
ERROR: invalid input syntax for type real: "NaN x"
70+
SELECT ' INFINITY x'::float4;
71+
ERROR: invalid input syntax for type real: " INFINITY x"
72+
SELECT 'Infinity'::float4 + 100.0;
73+
ERROR: type "double precision" value out of range: overflow
74+
SELECT 'Infinity'::float4 / 'Infinity'::float4;
75+
?column?
76+
----------
77+
NaN
78+
(1 row)
79+
80+
SELECT 'nan'::float4 / 'nan'::float4;
81+
?column?
82+
----------
83+
NaN
84+
(1 row)
85+
1986
SELECT '' AS five, FLOAT4_TBL.*;
2087
five | f1
2188
------+--------------

‎src/test/regress/expected/float8-exp-three-digits-win32.out

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,82 @@ INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
77
INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
88
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
99
INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
10+
-- test for underflow and overflow
11+
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
12+
ERROR: "10e400" is out of range for type double precision
13+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
14+
ERROR: "-10e400" is out of range for type double precision
15+
INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
16+
ERROR: "10e-400" is out of range for type double precision
17+
INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
18+
ERROR: "-10e-400" is out of range for type double precision
19+
-- bad input
20+
INSERT INTO FLOAT8_TBL(f1) VALUES (' ');
21+
ERROR: invalid input syntax for type double precision: " "
22+
INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
23+
ERROR: invalid input syntax for type double precision: "xyz"
24+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
25+
ERROR: invalid input syntax for type double precision: "5.0.0"
26+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
27+
ERROR: invalid input syntax for type double precision: "5 . 0"
28+
INSERT INTO FLOAT8_TBL(f1) VALUES ('5. 0');
29+
ERROR: invalid input syntax for type double precision: "5. 0"
30+
INSERT INTO FLOAT8_TBL(f1) VALUES (' - 3');
31+
ERROR: invalid input syntax for type double precision: " - 3"
32+
INSERT INTO FLOAT8_TBL(f1) VALUES ('123 5');
33+
ERROR: invalid input syntax for type double precision: "123 5"
34+
-- special inputs
35+
SELECT 'NaN'::float8;
36+
float8
37+
--------
38+
NaN
39+
(1 row)
40+
41+
SELECT 'nan'::float8;
42+
float8
43+
--------
44+
NaN
45+
(1 row)
46+
47+
SELECT ' NAN '::float8;
48+
float8
49+
--------
50+
NaN
51+
(1 row)
52+
53+
SELECT 'infinity'::float8;
54+
float8
55+
----------
56+
Infinity
57+
(1 row)
58+
59+
SELECT ' -INFINiTY '::float8;
60+
float8
61+
-----------
62+
-Infinity
63+
(1 row)
64+
65+
-- bad special inputs
66+
SELECT 'N A N'::float8;
67+
ERROR: invalid input syntax for type double precision: "N A N"
68+
SELECT 'NaN x'::float8;
69+
ERROR: invalid input syntax for type double precision: "NaN x"
70+
SELECT ' INFINITY x'::float8;
71+
ERROR: invalid input syntax for type double precision: " INFINITY x"
72+
SELECT 'Infinity'::float8 + 100.0;
73+
ERROR: type "double precision" value out of range: overflow
74+
SELECT 'Infinity'::float8 / 'Infinity'::float8;
75+
?column?
76+
----------
77+
NaN
78+
(1 row)
79+
80+
SELECT 'nan'::float8 / 'nan'::float8;
81+
?column?
82+
----------
83+
NaN
84+
(1 row)
85+
1086
SELECT '' AS five, FLOAT8_TBL.*;
1187
five | f1
1288
------+----------------------

‎src/test/regress/resultmap

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ horology/sparc-sun-solaris=horology-solaris-1947
2525
horology/sparc-sun-sunos4.*=horology-no-DST-before-1970
2626
horology/.*-sysv5=horology-solaris-1947
2727
horology/.*-sco=horology-solaris-1947
28+
horology/win32=horology-no-DST-before-1970
2829
int8/.*-qnx=int8-exp-three-digits
2930
int8/win32=int8-exp-three-digits-win32
3031
tinterval/.*-aix4=tinterval-solaris-1947

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp