]> git.ipfire.org Git - thirdparty/postgresql.git/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:07 +0000 (04:14 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 5 Dec 2005 04:14:07 +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 5e6bee8cc792015c0481e87265d5505e53e62fa4..8dcfb2ce7ed8be662e010bb1da0e2b3d336cc110 100644 (file)
@@ -300,3 +300,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:  value "-9223372036854775809" is out of range for type bigint
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  value "9223372036854775808" is out of range for type bigint
index 164285dd65a36ef1ede03bddadf92ca5609ac74d..87aae26565cf2c3599c218b4b071c4bdddbfa346 100644 (file)
@@ -300,3 +300,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:  value "-9223372036854775809" is out of range for type bigint
+select '9223372036854775807'::int8;
+        int8         
+---------------------
+ 9223372036854775807
+(1 row)
+
+select '9223372036854775808'::int8;
+ERROR:  value "9223372036854775808" is out of range for type bigint
index ec7766219d63e578740970cb1e3f902432ab0a82..560dad19c4a733d7267b1eb8f00056a79aac3760 100644 (file)
@@ -63,3 +63,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;