Solaris 8 regression test failure with 8.0.0beta5

Started by Kenneth Marshallabout 21 years ago4 messages
#1Kenneth Marshall
ktm@it.is.rice.edu

Here are the diffs for the regression test failures on Solaris 8.
The tests work fine on Redhat9 and Redhat Enterprise Linux 3.

Ken Marshall

*** ./expected/errors.out	Sat Mar 13 22:25:17 2004
--- ./results/errors.out	Tue Nov 23 14:09:45 2004
***************
*** 297,303 ****
  -- Check that division-by-zero is properly caught.
  --
  select 1/0;
! ERROR:  division by zero
  select 1::int8/0;
  ERROR:  division by zero
  select 1/0::int8;
--- 297,304 ----
  -- Check that division-by-zero is properly caught.
  --
  select 1/0;
! ERROR:  floating-point exception
! DETAIL:  An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.
  select 1::int8/0;
  ERROR:  division by zero
  select 1/0::int8;

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

*** ./expected/transactions.out	Mon Sep 13 15:09:51 2004
--- ./results/transactions.out	Tue Nov 23 14:09:50 2004
***************
*** 290,296 ****
  BEGIN;
    SAVEPOINT one;
    SELECT 0/0;
! ERROR:  division by zero
    SAVEPOINT two;    -- ignored till the end of ...
  ERROR:  current transaction is aborted, commands ignored until end of transaction block
    RELEASE SAVEPOINT one;      -- ignored till the end of ...
--- 290,297 ----
  BEGIN;
    SAVEPOINT one;
    SELECT 0/0;
! ERROR:  floating-point exception
! DETAIL:  An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.
    SAVEPOINT two;    -- ignored till the end of ...
  ERROR:  current transaction is aborted, commands ignored until end of transaction block
    RELEASE SAVEPOINT one;      -- ignored till the end of ...
***************
*** 364,370 ****
  	DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1;
  	SAVEPOINT two;
  		FETCH 10 FROM c;
! ERROR:  division by zero
  	ROLLBACK TO SAVEPOINT two;
  	-- c is now dead to the world ...
  		FETCH 10 FROM c;
--- 365,372 ----
  	DECLARE c CURSOR FOR SELECT unique2/0 FROM tenk1;
  	SAVEPOINT two;
  		FETCH 10 FROM c;
! ERROR:  floating-point exception
! DETAIL:  An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.
  	ROLLBACK TO SAVEPOINT two;
  	-- c is now dead to the world ...
  		FETCH 10 FROM c;

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

*** ./expected/plpgsql.out	Tue Nov 16 12:10:15 2004
--- ./results/plpgsql.out	Tue Nov 23 14:10:17 2004
***************
*** 1826,1837 ****
  select trap_zero_divide(0);
  NOTICE:  should see this
! NOTICE:  caught division_by_zero
!  trap_zero_divide 
! ------------------
!                -1
! (1 row)
! 
  select trap_zero_divide(100000);
  NOTICE:  should see this
  NOTICE:  should see this only if 100000 <> 0
--- 1826,1834 ----

select trap_zero_divide(0);
NOTICE: should see this
! ERROR: floating-point exception
! DETAIL: An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.
! CONTEXT: PL/pgSQL function "trap_zero_divide" line 6 at assignment
select trap_zero_divide(100000);
NOTICE: should see this
NOTICE: should see this only if 100000 <> 0

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

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Kenneth Marshall (#1)
Re: Solaris 8 regression test failure with 8.0.0beta5

Kenneth Marshall <ktm@is.rice.edu> writes:

Here are the diffs for the regression test failures on Solaris 8.
The tests work fine on Redhat9 and Redhat Enterprise Linux 3.

... and most other platforms ...

select 1/0;
! ERROR: floating-point exception
! DETAIL: An invalid floating-point operation was signaled. This probably means an out-of-range result or an invalid operation, such as division by zero.

This query would invoke the following code in int4div:

if (arg2 == 0)
ereport(ERROR,
(errcode(ERRCODE_DIVISION_BY_ZERO),
errmsg("division by zero")));

result = arg1 / arg2;

I suggest directing some strong words to your compiler vendor. If the
"if" test doesn't complete before the subsequent division causes a trap,
that is not our problem.

regards, tom lane

#3Greg Stark
gsstark@mit.edu
In reply to: Tom Lane (#2)
Re: Solaris 8 regression test failure with 8.0.0beta5

Tom Lane <tgl@sss.pgh.pa.us> writes:

This query would invoke the following code in int4div:

if (arg2 == 0)
ereport(ERROR,
(errcode(ERRCODE_DIVISION_BY_ZERO),
errmsg("division by zero")));

result = arg1 / arg2;

I suggest directing some strong words to your compiler vendor. If the
"if" test doesn't complete before the subsequent division causes a trap,
that is not our problem.

I have a vague memory that IEEE floats have zero coming in two flavours, 0 and
-0. I wonder if it's possible merely comparing against 0 isn't covering all
the possible cases that can trigger a division by zero trap.

--
greg

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Greg Stark (#3)
Re: Solaris 8 regression test failure with 8.0.0beta5

Greg Stark <gsstark@mit.edu> writes:

Tom Lane <tgl@sss.pgh.pa.us> writes:

This query would invoke the following code in int4div:

if (arg2 == 0)

I have a vague memory that IEEE floats have zero coming in two
flavours, 0 and -0. I wonder if it's possible merely comparing against
0 isn't covering all the possible cases that can trigger a division by
zero trap.

(a) This is an integer, not a float.

(b) The IEEE spec requires that 0 and -0 compare equal.

regards, tom lane