Skip to content

Commit 8cb4e4f

Browse files
committed
Add regression test to see if the min/max values of int8 convert correctly.
1 parent 3311c76 commit 8cb4e4f

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

src/test/regress/expected/int8-exp-three-digits.out

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
300300
| 456789-0123456789
301301
(5 rows)
302302

303+
-- check min/max values
304+
select '-9223372036854775808'::int8;
305+
int8
306+
----------------------
307+
-9223372036854775808
308+
(1 row)
309+
310+
select '-9223372036854775809'::int8;
311+
ERROR: value "-9223372036854775809" is out of range for type bigint
312+
select '9223372036854775807'::int8;
313+
int8
314+
---------------------
315+
9223372036854775807
316+
(1 row)
317+
318+
select '9223372036854775808'::int8;
319+
ERROR: value "9223372036854775808" is out of range for type bigint

src/test/regress/expected/int8.out

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,3 +300,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
300300
| 456789-0123456789
301301
(5 rows)
302302

303+
-- check min/max values
304+
select '-9223372036854775808'::int8;
305+
int8
306+
----------------------
307+
-9223372036854775808
308+
(1 row)
309+
310+
select '-9223372036854775809'::int8;
311+
ERROR: value "-9223372036854775809" is out of range for type bigint
312+
select '9223372036854775807'::int8;
313+
int8
314+
---------------------
315+
9223372036854775807
316+
(1 row)
317+
318+
select '9223372036854775808'::int8;
319+
ERROR: value "9223372036854775808" is out of range for type bigint

src/test/regress/sql/int8.sql

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,3 +63,9 @@ SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
6363
SELECT '' AS to_char_15, to_char(q2, 'S 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 . 9 9 9') FROM INT8_TBL;
6464
SELECT '' AS to_char_16, to_char(q2, E'99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
6565
SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
66+
67+
-- check min/max values
68+
select '-9223372036854775808'::int8;
69+
select '-9223372036854775809'::int8;
70+
select '9223372036854775807'::int8;
71+
select '9223372036854775808'::int8;

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy