]> granicus.if.org Git - postgresql/commitdiff
Add regression test to see if the min/max values of int8 convert correctly.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Dec 2005 04:14:27 +0000 (04:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Dec 2005 04:14:27 +0000 (04:14 +0000)
src/test/regress/expected/int8-exp-three-digits.out
src/test/regress/expected/int8.out
src/test/regress/sql/int8.sql

index e1eb64792c6a2d0a004c8af5c97034cdf929ea64..5e7b4b468c42890b0a8ccd7ae3aea147caab27ef 100644 (file)
@@ -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:  integer out of range
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  integer out of range
index 931889c4ad96595a6481987532799736fe40639f..ef51a1f163f1200cd33195adbc8cc25cbb9789d6 100644 (file)
@@ -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:  integer out of range
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  integer out of range
index b5cb13480be743bfeb686fc0abb5db4e0bd299b7..08fd665b11c9e974012c54c57177b015804613e7 100644 (file)
@@ -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;