Source: CSV HEAD (As of yesterday)
Platform: HP PARISC (HP 710)
OS: Debian Sarge
File: src/backend/utils/adt/float.c
Change:
CheckFloat4Val(result);
To:
CheckFloat4Val((float4)result);
I tested this on my parisc box and it passed all tests. This could just be an
issue with a very old CPU/floating
point unit.
I can send a patch in, but since this seems to work on other platforms, I
thought I would ask here first.
Sorry about the cryptic message, it was before my first cup of java.
Jim
------------------------------------------------
Datum
float4div(PG_FUNCTION_ARGS)
{
float4 arg1 = PG_GETARG_FLOAT4(0);
float4 arg2 = PG_GETARG_FLOAT4(1);
double result;
if (arg2 == 0.0)
ereport(ERROR,
(errcode(ERRCODE_DIVISION_BY_ZERO),
errmsg("division by zero")));
/* Do division in float8, then check for overflow */
result = (float8) arg1 / (float8) arg2;
CheckFloat4Val(result);
PG_RETURN_FLOAT4((float4) result);
}
---------- Original Message -----------
From: Tom Lane <[EMAIL PROTECTED]>
To: "Jim Buttafuoco" <[EMAIL PROTECTED]>
Cc: "pgsql-hackers" <[email protected]>
Sent: Tue, 01 Feb 2005 12:06:30 -0500
Subject: Re: [HACKERS] float4 regression test failed on linux parisc
> "Jim Buttafuoco" <[EMAIL PROTECTED]> writes:
> > I am getting a float4 regression test failure. I have extracted the SQL
> > from both the float4 and float8 tests
below.
> > Both should return NAN
>
> > I looked at the code, The float4div does the operation as float8's then
> > checks the value. The value is a valid
> > float8 NAN. The call to CheckFloat4Val is missing a cast back to float4.
> > If I put the cast in I get the expected
> > results (NAN).
>
> This report is about as clear as mud :-(. What platform is this, and
> what source code change are you proposing *exactly* ?
>
> regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]
------- End of Original Message -------
---------------------------(end of broadcast)---------------------------
TIP 9: the planner will ignore your desire to choose an index scan if your
joining column's datatypes do not match