Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-27 Thread Michael Meskes
On Fri, Feb 26, 2010 at 11:14:01AM -0500, Tom Lane wrote: > I think it would be a good idea, just to have all that code using > identical #includes. R�mi's problem may be a platform bug rather Sounds reasonable, done. Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-27 Thread Tom Lane
=?iso-8859-1?Q?R=E9mi_Zara?= writes: > Le 27 févr. 2010 à 17:57, Tom Lane a écrit : >> I don't think it's our bug to fix. > It would mean retiring pika until/if the bug is fixed... :-( Grumble ... well, I suppose we've put in worse platform-specific hacks elsewhere. At least this is pretty loca

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-27 Thread Rémi Zara
Le 27 févr. 2010 à 17:57, Tom Lane a écrit : > =?iso-8859-1?Q?R=E9mi_Zara?= writes: >> Le 26 févr. 2010 à 17:11, Tom Lane a écrit : >>> Hmm. So what do you get from >>> SELECT 'nan'::numeric::float8; > >> regression=# select 'nan'::numeric::float8; >> float8 >> -- >> Infinity >> (1

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-27 Thread Tom Lane
=?iso-8859-1?Q?R=E9mi_Zara?= writes: > Le 26 févr. 2010 à 17:11, Tom Lane a écrit : >> Hmm. So what do you get from >> SELECT 'nan'::numeric::float8; > regression=# select 'nan'::numeric::float8; > float8 > -- > Infinity > (1 row) > So it is indeed the same behavior. Yeah. So wha

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-27 Thread Rémi Zara
Le 26 févr. 2010 à 17:11, Tom Lane a écrit : > =?iso-8859-1?Q?R=E9mi_Zara?= writes: >> I've tried patch 1 and 2, but they do not work. The fact is that the code is >> not used in the backend, because strtod("NaN", endptr) works. >> (isnan(strtod("NaN", endptr)) is true). > > Hmm. So what do

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-26 Thread Tom Lane
Michael Meskes writes: > On Fri, Feb 26, 2010 at 12:12:10PM +0100, Boszormenyi Zoltan wrote: >> Michael, can we try to install the first two patches? > If I understood the rest of the thread correctly this is not needed anymore, > right? I think it would be a good idea, just to have all that cod

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-26 Thread Tom Lane
=?iso-8859-1?Q?R=E9mi_Zara?= writes: > I've tried patch 1 and 2, but they do not work. The fact is that the code is > not used in the backend, because strtod("NaN", endptr) works. > (isnan(strtod("NaN", endptr)) is true). Hmm. So what do you get from SELECT 'nan'::numeric::float8; on t

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-26 Thread Michael Meskes
On Fri, Feb 26, 2010 at 12:12:10PM +0100, Boszormenyi Zoltan wrote: > Michael, can we try to install the first two patches? If I understood the rest of the thread correctly this is not needed anymore, right? Michael -- Michael Meskes Michael at Fam-Meskes dot De, Michael at Meskes dot (De|Com|Ne

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-26 Thread Rémi Zara
Le 26 févr. 2010 à 12:12, Boszormenyi Zoltan a écrit : > > ecpglib/data.c includes "postgres_fe.h", so it should be pulling > everything that's relevant from port/*, right? > > Michael, can we try to install the first two patches? > They wouldn't hurt. > I've tried patch 1 and 2, but they do

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-26 Thread Boszormenyi Zoltan
Tom Lane írta: > Boszormenyi Zoltan writes: > >> Can you try whether the first patch (missing float.h from data.c) >> solves the problem? And together with the 2nd one? In that >> patch I fixed the order of float.h and math.h in nan_test.pgc, >> which is the opposite of the order found in e.g.

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-25 Thread Tom Lane
Boszormenyi Zoltan writes: > Can you try whether the first patch (missing float.h from data.c) > solves the problem? And together with the 2nd one? In that > patch I fixed the order of float.h and math.h in nan_test.pgc, > which is the opposite of the order found in e.g. backend/utils/adt/float.c.

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-25 Thread Rémi Zara
Le 17 févr. 2010 à 12:18, Boszormenyi Zoltan a écrit : > > > Is this buildfarm member for detecting bugs in the already > obsolete NetBSD 5.0 BETA, or what? The final 5.0 and > two bugfix releases are already out for a while. The owner > of that particular machine should upgrade. I upgraded p

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-25 Thread Boszormenyi Zoltan
I wrote: > As Rémi says, isnan((double)(0.0 / 0.0)) == true for him. > Michael: IIRC, IEEE754 explicit about that the (0.0/0.0) division > produces NaN. How about doing it explicitely in ECPG? > I came up with three patches, they are attached. Can you try whether the first patch (missing float

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-25 Thread Rémi Zara
Le 25 févr. 2010 à 11:26, Boszormenyi Zoltan a écrit : > > NAN on NetBSD/x86-64 is defined as: > > extern const union __float_u __nanf; > #define NAN __nanf.__val > Same here: math.h:extern const union __float_u __nanf; math.h:#define NAN __nanf.__val > I would guess that

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-25 Thread Boszormenyi Zoltan
Rémi Zara írta: > Le 24 févr. 2010 à 18:58, Boszormenyi Zoltan a écrit : > >> Here's the attached test code. Compile it with >> >> gcc -Wall -o nantest nantest.c -lm >> >> and run it. It tests NAN anf INFINITY values with isinf() and isnan(). >> The expected output is: >> >> == >

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-24 Thread Rémi Zara
Le 24 févr. 2010 à 18:58, Boszormenyi Zoltan a écrit : > > Here's the attached test code. Compile it with > > gcc -Wall -o nantest nantest.c -lm > > and run it. It tests NAN anf INFINITY values with isinf() and isnan(). > The expected output is: > > == > $ ./nantest > computed

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-24 Thread Boszormenyi Zoltan
Rémi Zara írta: > Le 17 févr. 2010 à 12:18, Boszormenyi Zoltan a écrit : > >> Is this buildfarm member for detecting bugs in the already >> obsolete NetBSD 5.0 BETA, or what? The final 5.0 and >> two bugfix releases are already out for a while. The owner >> of that particular machine should upgr

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-24 Thread Rémi Zara
Le 17 févr. 2010 à 12:18, Boszormenyi Zoltan a écrit : > Is this buildfarm member for detecting bugs in the already > obsolete NetBSD 5.0 BETA, or what? The final 5.0 and > two bugfix releases are already out for a while. The owner > of that particular machine should upgrade. I upgraded pika to

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-17 Thread Boszormenyi Zoltan
Boszormenyi Zoltan írta: > Michael Meskes írta: > >> On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote: >> >> >>> I was trying to stress the *beta* status. Maybe someone into NetBSD might >>> be >>> interested in reporting this as a bug. At least it behaves different to al

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-17 Thread Boszormenyi Zoltan
Michael Meskes írta: > On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote: > >> I was trying to stress the *beta* status. Maybe someone into NetBSD might be >> interested in reporting this as a bug. At least it behaves different to all >> other archs we have. >> > > Hmm, it se

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Michael Meskes
On Tue, Feb 16, 2010 at 10:28:00PM +0100, Michael Meskes wrote: > I was trying to stress the *beta* status. Maybe someone into NetBSD might be > interested in reporting this as a bug. At least it behaves different to all > other archs we have. Hmm, it seems the patch didn't work. Back to the dra

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Michael Meskes
> I realized my typo after sending my mail. Sorry if I offended anyone > calling NetBSD FreeBSD. :-) I was trying to stress the *beta* status. Maybe someone into NetBSD might be interested in reporting this as a bug. At least it behaves different to all other archs we have. Michael -- Michael

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Boszormenyi Zoltan
Michael Meskes írta: > On Tue, Feb 16, 2010 at 12:21:34PM +0100, Boszormenyi Zoltan wrote: > >>> Does FreeBSD/MIPS really return true for isinf(NaN)? >>> > > Actually it's a netbsd beta version, so maybe there's a bug in their libc. > I realized my typo after sending my mail. Sorry if

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Michael Meskes
On Tue, Feb 16, 2010 at 12:21:34PM +0100, Boszormenyi Zoltan wrote: > > Does FreeBSD/MIPS really return true for isinf(NaN)? Actually it's a netbsd beta version, so maybe there's a bug in their libc. But anyway, the patch doesn't seem to hurt, so I committed it. Michael -- Michael Meskes Micha

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Boszormenyi Zoltan
Boszormenyi Zoltan írta: > Hi, > > buildfarm member "pika" fails the NaN test. > Does FreeBSD/MIPS really return true for isinf(NaN)? > Anyway, the attached patch tries to fix the test case > by testing isnan() first and doesn't check isinf() > if isnan() returned true. > I lied in the patch na

Re: [HACKERS] NaN/Inf fix for ECPG

2010-02-16 Thread Boszormenyi Zoltan
Hi, buildfarm member "pika" fails the NaN test. Does FreeBSD/MIPS really return true for isinf(NaN)? Anyway, the attached patch tries to fix the test case by testing isnan() first and doesn't check isinf() if isnan() returned true. Best regards, Zoltán Böszörményi -- Bible has answers for every