float8 regression test failure in head

Started by Christopher Kings-Lynnealmost 22 years ago12 messages
#1Christopher Kings-Lynne
chriskl@familyhealth.com.au
2 attachment(s)

Attached are the test failures I'm currently getting.

-bash-2.05b$ uname -a
FreeBSD mir.internal 4.9-PRERELEASE FreeBSD 4.9-PRERELEASE #0: Mon Sep
22 14:46:18 WST 2003 adrian@mir.internal:/usr/obj/usr/src/sys/MIR i386

Chris

Attachments:

regression.outtext/plain; name=regression.outDownload
regression.diffstext/plain; name=regression.diffsDownload
*** ./expected/float8-small-is-zero.out	Fri Sep 26 00:16:34 2003
--- ./results/float8.out	Thu Mar 18 11:26:20 2004
***************
*** 7,12 ****
--- 7,86 ----
  INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+ -- test for underflow and overflow
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
+ ERROR:  "10e400" is out of range for type double precision
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
+ ERROR:  "-10e400" is out of range for type double precision
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ -- bad input
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
+ ERROR:  invalid input syntax for type double precision: "     "
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ERROR:  invalid input syntax for type double precision: "xyz"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ERROR:  invalid input syntax for type double precision: "5.0.0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ERROR:  invalid input syntax for type double precision: "5 . 0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.   0');
+ ERROR:  invalid input syntax for type double precision: "5.   0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('    - 3');
+ ERROR:  invalid input syntax for type double precision: "    - 3"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('123           5');
+ ERROR:  invalid input syntax for type double precision: "123           5"
+ -- special inputs
+ SELECT 'NaN'::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT 'nan'::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT '   NAN  '::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT 'infinity'::float8;
+   float8  
+ ----------
+  Infinity
+ (1 row)
+ 
+ SELECT '          -INFINiTY   '::float8;
+   float8   
+ -----------
+  -Infinity
+ (1 row)
+ 
+ -- bad special inputs
+ SELECT 'N A N'::float8;
+ ERROR:  invalid input syntax for type double precision: "N A N"
+ SELECT 'NaN x'::float8;
+ ERROR:  invalid input syntax for type double precision: "NaN x"
+ SELECT ' INFINITY    x'::float8;
+ ERROR:  invalid input syntax for type double precision: " INFINITY    x"
+ SELECT 'Infinity'::float8 + 100.0;
+ ERROR:  type "double precision" value out of range: overflow
+ SELECT 'Infinity'::float8 / 'Infinity'::float8;
+  ?column? 
+ ----------
+       NaN
+ (1 row)
+ 
+ SELECT 'nan'::float8 / 'nan'::float8;
+  ?column? 
+ ----------
+       NaN
+ (1 row)
+ 
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
  ------+----------------------
***************
*** 15,21 ****
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
! (5 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
   four |          f1          
--- 89,97 ----
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
!       |                    0
!       |                   -0
! (7 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE f.f1 <> '1004.3';
   four |          f1          
***************
*** 24,30 ****
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
! (4 rows)
  
  SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
   one |   f1   
--- 100,108 ----
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
!       |                    0
!       |                   -0
! (6 rows)
  
  SELECT '' AS one, f.* FROM FLOAT8_TBL f WHERE f.f1 = '1004.3';
   one |   f1   
***************
*** 38,44 ****
         |                    0
         |               -34.84
         | 1.2345678901234e-200
! (3 rows)
  
  SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE  f.f1 < '1004.3';
   three |          f1          
--- 116,124 ----
         |                    0
         |               -34.84
         | 1.2345678901234e-200
!        |                    0
!        |                   -0
! (5 rows)
  
  SELECT '' AS three, f.* FROM FLOAT8_TBL f WHERE  f.f1 < '1004.3';
   three |          f1          
***************
*** 46,52 ****
         |                    0
         |               -34.84
         | 1.2345678901234e-200
! (3 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
   four |          f1          
--- 126,134 ----
         |                    0
         |               -34.84
         | 1.2345678901234e-200
!        |                    0
!        |                   -0
! (5 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE '1004.3' >= f.f1;
   four |          f1          
***************
*** 55,61 ****
        |               1004.3
        |               -34.84
        | 1.2345678901234e-200
! (4 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE  f.f1 <= '1004.3';
   four |          f1          
--- 137,145 ----
        |               1004.3
        |               -34.84
        | 1.2345678901234e-200
!       |                    0
!       |                   -0
! (6 rows)
  
  SELECT '' AS four, f.* FROM FLOAT8_TBL f WHERE  f.f1 <= '1004.3';
   four |          f1          
***************
*** 64,70 ****
        |               1004.3
        |               -34.84
        | 1.2345678901234e-200
! (4 rows)
  
  SELECT '' AS three, f.f1, f.f1 * '-10' AS x 
     FROM FLOAT8_TBL f
--- 148,156 ----
        |               1004.3
        |               -34.84
        | 1.2345678901234e-200
!       |                    0
!       |                   -0
! (6 rows)
  
  SELECT '' AS three, f.f1, f.f1 * '-10' AS x 
     FROM FLOAT8_TBL f
***************
*** 123,129 ****
        |               -34.84 |                34.84
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 | 1.2345678901234e-200
! (5 rows)
  
  -- truncate 
  SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
--- 209,217 ----
        |               -34.84 |                34.84
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 | 1.2345678901234e-200
!       |                    0 |                    0
!       |                   -0 |                    0
! (7 rows)
  
  -- truncate 
  SELECT '' AS five, f.f1, %f.f1 AS trunc_f1
***************
*** 135,141 ****
        |               -34.84 |                  -34
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 |                    0
! (5 rows)
  
  -- round 
  SELECT '' AS five, f.f1, f.f1 % AS round_f1
--- 223,231 ----
        |               -34.84 |                  -34
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 |                    0
!       |                    0 |                    0
!       |                   -0 |                   -0
! (7 rows)
  
  -- round 
  SELECT '' AS five, f.f1, f.f1 % AS round_f1
***************
*** 147,153 ****
        |               -34.84 |                  -35
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 |                    0
! (5 rows)
  
  -- ceil
  select ceil(f1) as ceil_f1 from float8_tbl f;
--- 237,245 ----
        |               -34.84 |                  -35
        | 1.2345678901234e+200 | 1.2345678901234e+200
        | 1.2345678901234e-200 |                    0
!       |                    0 |                    0
!       |                   -0 |                   -0
! (7 rows)
  
  -- ceil
  select ceil(f1) as ceil_f1 from float8_tbl f;
***************
*** 158,164 ****
                    -34
   1.2345678901234e+200
                      1
! (5 rows)
  
  -- floor
  select floor(f1) as floor_f1 from float8_tbl f;
--- 250,258 ----
                    -34
   1.2345678901234e+200
                      1
!                     0
!                    -0
! (7 rows)
  
  -- floor
  select floor(f1) as floor_f1 from float8_tbl f;
***************
*** 169,175 ****
                    -35
   1.2345678901234e+200
                      0
! (5 rows)
  
  -- sign
  select sign(f1) as sign_f1 from float8_tbl f;
--- 263,271 ----
                    -35
   1.2345678901234e+200
                      0
!                     0
!                    -0
! (7 rows)
  
  -- sign
  select sign(f1) as sign_f1 from float8_tbl f;
***************
*** 180,186 ****
        -1
         1
         1
! (5 rows)
  
  -- square root 
  SELECT sqrt(float8 '64') AS eight;
--- 276,284 ----
        -1
         1
         1
!        0
!        0
! (7 rows)
  
  -- square root 
  SELECT sqrt(float8 '64') AS eight;
***************
*** 231,237 ****
        |               -34.84 |    -3.26607421344208
        | 1.2345678901234e+200 | 4.97933859234765e+66
        | 1.2345678901234e-200 |  2.3112042409018e-67
! (5 rows)
  
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
--- 329,337 ----
        |               -34.84 |    -3.26607421344208
        | 1.2345678901234e+200 | 4.97933859234765e+66
        | 1.2345678901234e-200 |  2.3112042409018e-67
!       |                    0 |                    0
!       |                   -0 |                   -0
! (7 rows)
  
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
***************
*** 241,247 ****
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
! (5 rows)
  
  UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
--- 341,349 ----
        |               -34.84
        | 1.2345678901234e+200
        | 1.2345678901234e-200
!       |                    0
!       |                   -0
! (7 rows)
  
  UPDATE FLOAT8_TBL
     SET f1 = FLOAT8_TBL.f1 * '-1'
***************
*** 263,272 ****
  ------+-----------------------
        |                     0
        |                -34.84
        |               -1004.3
        | -1.2345678901234e+200
        | -1.2345678901234e-200
! (5 rows)
  
  -- test for over- and underflow 
  INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
--- 365,376 ----
  ------+-----------------------
        |                     0
        |                -34.84
+       |                     0
+       |                    -0
        |               -1004.3
        | -1.2345678901234e+200
        | -1.2345678901234e-200
! (7 rows)
  
  -- test for over- and underflow 
  INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');

======================================================================

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Christopher Kings-Lynne (#1)
Re: float8 regression test failure in head

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

Attached are the test failures I'm currently getting.

It looks like Neil didn't update expected/float8-small-is-zero.out
for his recent changes (for which, shame on him). Would you get
together to verify the correct regression outputs for your platform
and commit the updated expected file?

regards, tom lane

#3Christopher Kings-Lynne
chriskl@familyhealth.com.au
In reply to: Tom Lane (#2)
Re: float8 regression test failure in head

This has not yet been fixed...

Chris

Tom Lane wrote:

Show quoted text

Christopher Kings-Lynne <chriskl@familyhealth.com.au> writes:

Attached are the test failures I'm currently getting.

It looks like Neil didn't update expected/float8-small-is-zero.out
for his recent changes (for which, shame on him). Would you get
together to verify the correct regression outputs for your platform
and commit the updated expected file?

regards, tom lane

#4Neil Conway
neilc@samurai.com
In reply to: Christopher Kings-Lynne (#3)
1 attachment(s)
Re: float8 regression test failure in head

Christopher Kings-Lynne wrote:

This has not yet been fixed...

Attached is a patch for this issue. I've checked with Chris, and this
patch allows the regression tests to pass on his machine. I also
updated float8-exp-three-digits expected file, but I wasn't able to
test these changes (I don't have access to a QNX machine).

I intend to apply this patch tomorrow.

Cheers,

Neil

Attachments:

float8_regr_portability-1.patchtext/x-patch; name=float8_regr_portability-1.patchDownload
Index: src/test/regress/expected/float8-exp-three-digits-win32.out
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/test/regress/expected/float8-exp-three-digits-win32.out,v
retrieving revision 1.2
diff -c -r1.2 float8-exp-three-digits-win32.out
*** a/src/test/regress/expected/float8-exp-three-digits-win32.out	15 Mar 2004 16:20:52 -0000	1.2
--- b/src/test/regress/expected/float8-exp-three-digits-win32.out	23 Mar 2004 03:13:54 -0000
***************
*** 7,20 ****
  INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
! -- test for underflow and overflow
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
  ERROR:  "10e400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  ERROR:  "-10e400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
  ERROR:  "10e-400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
  ERROR:  "-10e-400" is out of range for type double precision
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
--- 7,20 ----
  INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
! -- test for underflow and overflow handling
! SELECT '10e400'::float8;
  ERROR:  "10e400" is out of range for type double precision
! SELECT '-10e400'::float8;
  ERROR:  "-10e400" is out of range for type double precision
! SELECT '10e-400'::float8;
  ERROR:  "10e-400" is out of range for type double precision
! SELECT '-10e-400'::float8;
  ERROR:  "-10e-400" is out of range for type double precision
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
Index: src/test/regress/expected/float8-exp-three-digits.out
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/test/regress/expected/float8-exp-three-digits.out,v
retrieving revision 1.7
diff -c -r1.7 float8-exp-three-digits.out
*** a/src/test/regress/expected/float8-exp-three-digits.out	25 Sep 2003 16:16:34 -0000	1.7
--- b/src/test/regress/expected/float8-exp-three-digits.out	23 Mar 2004 03:20:50 -0000
***************
*** 2,12 ****
  -- FLOAT8
  --
  CREATE TABLE FLOAT8_TBL(f1 float8);
! INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
  ------+----------------------
--- 2,87 ----
  -- FLOAT8
  --
  CREATE TABLE FLOAT8_TBL(f1 float8);
! INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+ -- test for underflow and overflow handling
+ SELECT '10e400'::float8;
+ ERROR:  "10e400" is out of range for type double precision
+ SELECT '-10e400'::float8;
+ ERROR:  "-10e400" is out of range for type double precision
+ SELECT '10e-400'::float8;
+ ERROR:  "10e-400" is out of range for type double precision
+ SELECT '-10e-400'::float8;
+ ERROR:  "-10e-400" is out of range for type double precision
+ -- bad input
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
+ ERROR:  invalid input syntax for type double precision: "     "
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ERROR:  invalid input syntax for type double precision: "xyz"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ERROR:  invalid input syntax for type double precision: "5.0.0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ERROR:  invalid input syntax for type double precision: "5 . 0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.   0');
+ ERROR:  invalid input syntax for type double precision: "5.   0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('    - 3');
+ ERROR:  invalid input syntax for type double precision: "    - 3"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('123           5');
+ ERROR:  invalid input syntax for type double precision: "123           5"
+ -- special inputs
+ SELECT 'NaN'::float8;
+  float8
+ --------
+     NaN
+ (1 row)
+ SELECT 'nan'::float8;
+  float8
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT '   NAN  '::float8;
+  float8
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT 'infinity'::float8;
+  float8
+ ----------
+  Infinity
+ (1 row)
+ 
+ SELECT '          -INFINiTY   '::float8;
+   float8
+ -----------
+  -Infinity
+ (1 row)
+ 
+ -- bad special inputs
+ SELECT 'N A N'::float8;
+ ERROR:  invalid input syntax for type double precision: "N A N"
+ SELECT 'NaN x'::float8;
+ ERROR:  invalid input syntax for type double precision: "NaN x"
+ SELECT ' INFINITY    x'::float8;
+ ERROR:  invalid input syntax for type double precision: " INFINITY    x"
+ SELECT 'Infinity'::float8 + 100.0;
+ ERROR:  type "double precision" value out of range: overflow
+ SELECT 'Infinity'::float8 / 'Infinity'::float8;
+  ?column?
+ ----------
+       NaN
+ (1 row)
+ 
+ SELECT 'nan'::float8 / 'nan'::float8;
+  ?column?
+ ----------
+       NaN
+ (1 row)
+ 
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
  ------+----------------------
Index: src/test/regress/expected/float8-small-is-zero.out
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/test/regress/expected/float8-small-is-zero.out,v
retrieving revision 1.5
diff -c -r1.5 float8-small-is-zero.out
*** a/src/test/regress/expected/float8-small-is-zero.out	25 Sep 2003 16:16:34 -0000	1.5
--- b/src/test/regress/expected/float8-small-is-zero.out	23 Mar 2004 03:36:37 -0000
***************
*** 2,12 ****
  -- FLOAT8
  --
  CREATE TABLE FLOAT8_TBL(f1 float8);
! INSERT INTO FLOAT8_TBL(f1) VALUES ('0.0');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
  ------+----------------------
--- 2,96 ----
  -- FLOAT8
  --
  CREATE TABLE FLOAT8_TBL(f1 float8);
! INSERT INTO FLOAT8_TBL(f1) VALUES ('    0.0   ');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('1004.30  ');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
+ -- test for underflow and overflow handling
+ SELECT '10e400'::float8;
+ ERROR:  "10e400" is out of range for type double precision
+ SELECT '-10e400'::float8;
+ ERROR:  "-10e400" is out of range for type double precision
+ SELECT '10e-400'::float8;
+  float8 
+ --------
+      0
+ (1 row)
+ 
+ SELECT '-10e-400'::float8;
+  float8 
+ --------
+     -0
+ (1 row)
+ 
+ -- bad input
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
+ ERROR:  invalid input syntax for type double precision: "     "
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('xyz');
+ ERROR:  invalid input syntax for type double precision: "xyz"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.0.0');
+ ERROR:  invalid input syntax for type double precision: "5.0.0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5 . 0');
+ ERROR:  invalid input syntax for type double precision: "5 . 0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('5.   0');
+ ERROR:  invalid input syntax for type double precision: "5.   0"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('    - 3');
+ ERROR:  invalid input syntax for type double precision: "    - 3"
+ INSERT INTO FLOAT8_TBL(f1) VALUES ('123           5');
+ ERROR:  invalid input syntax for type double precision: "123           5"
+ -- special inputs
+ SELECT 'NaN'::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT 'nan'::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT '   NAN  '::float8;
+  float8 
+ --------
+     NaN
+ (1 row)
+ 
+ SELECT 'infinity'::float8;
+   float8  
+ ----------
+  Infinity
+ (1 row)
+ 
+ SELECT '          -INFINiTY   '::float8;
+   float8   
+ -----------
+  -Infinity
+ (1 row)
+ 
+ -- bad special inputs
+ SELECT 'N A N'::float8;
+ ERROR:  invalid input syntax for type double precision: "N A N"
+ SELECT 'NaN x'::float8;
+ ERROR:  invalid input syntax for type double precision: "NaN x"
+ SELECT ' INFINITY    x'::float8;
+ ERROR:  invalid input syntax for type double precision: " INFINITY    x"
+ SELECT 'Infinity'::float8 + 100.0;
+ ERROR:  type "double precision" value out of range: overflow
+ SELECT 'Infinity'::float8 / 'Infinity'::float8;
+  ?column? 
+ ----------
+       NaN
+ (1 row)
+ 
+ SELECT 'nan'::float8 / 'nan'::float8;
+  ?column? 
+ ----------
+       NaN
+ (1 row)
+ 
  SELECT '' AS five, FLOAT8_TBL.*;
   five |          f1          
  ------+----------------------
Index: src/test/regress/expected/float8.out
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/test/regress/expected/float8.out,v
retrieving revision 1.19
diff -c -r1.19 float8.out
*** a/src/test/regress/expected/float8.out	12 Mar 2004 00:25:40 -0000	1.19
--- b/src/test/regress/expected/float8.out	23 Mar 2004 03:12:28 -0000
***************
*** 7,20 ****
  INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
! -- test for underflow and overflow
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
  ERROR:  "10e400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
  ERROR:  "-10e400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
  ERROR:  "10e-400" is out of range for type double precision
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
  ERROR:  "-10e-400" is out of range for type double precision
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
--- 7,20 ----
  INSERT INTO FLOAT8_TBL(f1) VALUES ('   -34.84');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
! -- test for underflow and overflow handling
! SELECT '10e400'::float8;
  ERROR:  "10e400" is out of range for type double precision
! SELECT '-10e400'::float8;
  ERROR:  "-10e400" is out of range for type double precision
! SELECT '10e-400'::float8;
  ERROR:  "10e-400" is out of range for type double precision
! SELECT '-10e-400'::float8;
  ERROR:  "-10e-400" is out of range for type double precision
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
Index: src/test/regress/sql/float8.sql
===================================================================
RCS file: /var/lib/cvs/pgsql-server/src/test/regress/sql/float8.sql,v
retrieving revision 1.10
diff -c -r1.10 float8.sql
*** a/src/test/regress/sql/float8.sql	12 Mar 2004 00:25:43 -0000	1.10
--- b/src/test/regress/sql/float8.sql	23 Mar 2004 03:08:01 -0000
***************
*** 10,20 ****
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
  
! -- test for underflow and overflow
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e400');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
! INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
  
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
--- 10,20 ----
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e+200');
  INSERT INTO FLOAT8_TBL(f1) VALUES ('1.2345678901234e-200');
  
! -- test for underflow and overflow handling
! SELECT '10e400'::float8;
! SELECT '-10e400'::float8;
! SELECT '10e-400'::float8;
! SELECT '-10e-400'::float8;
  
  -- bad input
  INSERT INTO FLOAT8_TBL(f1) VALUES ('     ');
#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Neil Conway (#4)
Re: float8 regression test failure in head

Neil Conway <neilc@samurai.com> writes:

Attached is a patch for this issue. I've checked with Chris, and this
patch allows the regression tests to pass on his machine. I also
updated float8-exp-three-digits expected file, but I wasn't able to
test these changes (I don't have access to a QNX machine).

FWIW, my procedure for handling updates in regression tests that have
multiple expected variants is to apply the same diff that occurs on the
machines I can test to the variants I can't test. It's possible that
this will be wrong, but 99% of the time it's right and it saves followup
work.

An easy way to apply such changes is to feed a default-format diff
output to patch(1):

diff test.myplatform.orig test.myplatform | patch

patch then bleats about not knowing which file to patch, and you
tell it "test.otherplatform". Works every time ...

regards, tom lane

#6Neil Conway
neilc@samurai.com
In reply to: Neil Conway (#4)
Re: float8 regression test failure in head

On 22-Mar-04, at 11:03 PM, Neil Conway wrote:

Attached is a patch for this issue.

Patch applied to CVS HEAD.

-Neil

#7Patrick Welche
prlw1@newn.cam.ac.uk
In reply to: Neil Conway (#4)
1 attachment(s)
Re: float8 regression test failure in head

On Mon, Mar 22, 2004 at 11:03:38PM -0500, Neil Conway wrote:

Christopher Kings-Lynne wrote:

This has not yet been fixed...

Attached is a patch for this issue. I've checked with Chris, and this
patch allows the regression tests to pass on his machine. I also
updated float8-exp-three-digits expected file, but I wasn't able to
test these changes (I don't have access to a QNX machine).

Mystery: why I haven't I seen this problem before in the last 2 years...
Anyway, on NetBSD-3.99.17/i386, I need the included patch to pass float8.
float8-small-is-zero_1.out probably needs it too, float8.out and
float8-exp-three-digits-win32.out already look OK.

Cheers,

Patrick

Attachments:

float8.pattext/plain; charset=us-asciiDownload
Index: float8-small-is-zero.out
===================================================================
RCS file: /projects/cvsroot/pgsql/src/test/regress/expected/float8-small-is-zero.out,v
retrieving revision 1.10
diff -u -r1.10 float8-small-is-zero.out
--- float8-small-is-zero.out	8 Jun 2005 21:15:29 -0000	1.10
+++ float8-small-is-zero.out	5 Apr 2006 14:26:25 -0000
@@ -13,17 +13,9 @@
 SELECT '-10e400'::float8;
 ERROR:  "-10e400" is out of range for type double precision
 SELECT '10e-400'::float8;
- float8 
---------
-     0
-(1 row)
-
+ERROR:  "10e-400" is out of range for type double precision
 SELECT '-10e-400'::float8;
- float8 
---------
-    -0
-(1 row)
-
+ERROR:  "-10e-400" is out of range for type double precision
 -- bad input
 INSERT INTO FLOAT8_TBL(f1) VALUES ('');
 ERROR:  invalid input syntax for type double precision: ""
@@ -377,7 +369,9 @@
 INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e400');
 ERROR:  "-10e400" is out of range for type double precision
 INSERT INTO FLOAT8_TBL(f1) VALUES ('10e-400');
+ERROR:  "10e-400" is out of range for type double precision
 INSERT INTO FLOAT8_TBL(f1) VALUES ('-10e-400');
+ERROR:  "-10e-400" is out of range for type double precision
 -- maintain external table consistency across platforms
 -- delete all values and reinsert well-behaved ones
 DELETE FROM FLOAT8_TBL;
#8Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Patrick Welche (#7)
Re: float8 regression test failure in head

Patrick Welche wrote:

On Mon, Mar 22, 2004 at 11:03:38PM -0500, Neil Conway wrote:

Christopher Kings-Lynne wrote:

This has not yet been fixed...

Attached is a patch for this issue. I've checked with Chris, and this
patch allows the regression tests to pass on his machine. I also
updated float8-exp-three-digits expected file, but I wasn't able to
test these changes (I don't have access to a QNX machine).

Mystery: why I haven't I seen this problem before in the last 2 years...
Anyway, on NetBSD-3.99.17/i386, I need the included patch to pass float8.
float8-small-is-zero_1.out probably needs it too, float8.out and
float8-exp-three-digits-win32.out already look OK.

You realize that all these platforms use the same file:

float8/i.86-.*-freebsd[234]=float8-small-is-zero
float8/i.86-.*-openbsd=float8-small-is-zero
float8/i.86-.*-netbsd=float8-small-is-zero
float8/m68k-.*-netbsd=float8-small-is-zero

Are we going to have to make a NetBSD/i386-specific file to fix this?
Don't we have some of these platforms on the build farm. Are they
failing?

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#8)
Re: float8 regression test failure in head

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Don't we have some of these platforms on the build farm. Are they
failing?

canary, gazelle, and osprey all pass this test just fine. Before
accepting any patches in this area we'd better find out the difference
between the OP's netbsd system and those machines.

regards, tom lane

#10Bruce Momjian
pgman@candle.pha.pa.us
In reply to: Tom Lane (#9)
Re: float8 regression test failure in head

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Don't we have some of these platforms on the build farm. Are they
failing?

canary, gazelle, and osprey all pass this test just fine. Before
accepting any patches in this area we'd better find out the difference
between the OP's netbsd system and those machines.

Agreed.

--
Bruce Momjian http://candle.pha.pa.us
EnterpriseDB http://www.enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

#11Patrick Welche
prlw1@newn.cam.ac.uk
In reply to: Bruce Momjian (#10)
Re: float8 regression test failure in head

On Thu, Apr 20, 2006 at 11:56:29AM -0400, Bruce Momjian wrote:

Tom Lane wrote:

Bruce Momjian <pgman@candle.pha.pa.us> writes:

Don't we have some of these platforms on the build farm. Are they
failing?

canary, gazelle, and osprey all pass this test just fine. Before
accepting any patches in this area we'd better find out the difference
between the OP's netbsd system and those machines.

Agreed.

Quoting from my original post "NetBSD-3.99.17/i386" - so what are you
running?

.. and just to check:

patrimoine=# select '1e-400'::float;
ERROR: "1e-400" is out of range for type double precision
patrimoine=# select version();
version
-------------------------------------------------------------------------------------------------------------
PostgreSQL 8.2devel on i386-unknown-netbsdelf3.99.17, compiled by GCC gcc (GCC) 3.3.3 (NetBSD nb3 20040520)
(1 row)

1e-400 wasn't rounded down to 0.

Cheers,

Patrick

#12Tom Lane
tgl@sss.pgh.pa.us
In reply to: Patrick Welche (#11)
Re: float8 regression test failure in head

Patrick Welche <prlw1@newn.cam.ac.uk> writes:

canary, gazelle, and osprey all pass this test just fine. Before
accepting any patches in this area we'd better find out the difference
between the OP's netbsd system and those machines.

Quoting from my original post "NetBSD-3.99.17/i386" - so what are you
running?

http://www.pgbuildfarm.org/cgi-bin/show_members.pl

The entries in the buildfarm list say things like "NetBSD 3.0". Is 3.99
newer? If so, has its underflow handling changed?

regards, tom lane