summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane2005-12-05 04:14:39 +0000
committerTom Lane2005-12-05 04:14:39 +0000
commit304b231e7bc808f909ac497c809c6a31975f9372 (patch)
tree5fb4e826a703cd204d3a9c2e7638b3f87829a384
parent62b91ec93798436dc5e22b98da25259a8d6485b3 (diff)
Add regression test to see if the min/max values of int8 convert correctly.
-rw-r--r--src/test/regress/expected/int8-exp-three-digits.out17
-rw-r--r--src/test/regress/expected/int8.out17
-rw-r--r--src/test/regress/sql/int8.sql6
3 files changed, 40 insertions, 0 deletions
diff --git a/src/test/regress/expected/int8-exp-three-digits.out b/src/test/regress/expected/int8-exp-three-digits.out
index e1eb64792c6..3ecc9a64a52 100644
--- a/src/test/regress/expected/int8-exp-three-digits.out
+++ b/src/test/regress/expected/int8-exp-three-digits.out
@@ -283,3 +283,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
| 456789-0123456789
(5 rows)
+-- check min/max values
+select '-9223372036854775808'::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR: int8 value out of range: "-9223372036854775809"
+select '9223372036854775807'::int8;
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR: int8 value out of range: "9223372036854775808"
diff --git a/src/test/regress/expected/int8.out b/src/test/regress/expected/int8.out
index e05bdc89714..9e620db7f13 100644
--- a/src/test/regress/expected/int8.out
+++ b/src/test/regress/expected/int8.out
@@ -283,3 +283,20 @@ SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
| 456789-0123456789
(5 rows)
+-- check min/max values
+select '-9223372036854775808'::int8;
+ int8
+----------------------
+ -9223372036854775808
+(1 row)
+
+select '-9223372036854775809'::int8;
+ERROR: int8 value out of range: "-9223372036854775809"
+select '9223372036854775807'::int8;
+ int8
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR: int8 value out of range: "9223372036854775808"
diff --git a/src/test/regress/sql/int8.sql b/src/test/regress/sql/int8.sql
index b5cb13480be..08fd665b11c 100644
--- a/src/test/regress/sql/int8.sql
+++ b/src/test/regress/sql/int8.sql
@@ -53,3 +53,9 @@ SELECT '' AS to_char_14, to_char(q2, 'FM9999999999999999.999') FROM INT8_TBL;
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;
SELECT '' AS to_char_16, to_char(q2, '99999 "text" 9999 "9999" 999 "\\"text between quote marks\\"" 9999') FROM INT8_TBL;
SELECT '' AS to_char_17, to_char(q2, '999999SG9999999999') FROM INT8_TBL;
+
+-- check min/max values
+select '-9223372036854775808'::int8;
+select '-9223372036854775809'::int8;
+select '9223372036854775807'::int8;
+select '9223372036854775808'::int8;