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

Commit8cb4e4f

Browse files
committed
Add regression test to see if the min/max values of int8 convert correctly.
1 parent3311c76 commit8cb4e4f

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)

[8]ページ先頭

©2009-2025 Movatter.jp