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.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. The 3rd patch is explicit about NetBSD/mips but it doesn't feel right. They are working on Linux/x86-64 and NetBSD/x86-64. Can you try the combinations below on "pika" outside the buildfarm whether they still fail the ECPG make check? - patch 1 by itself (12a) - patch 1+2 (12a + 12-regr) - patch 3 with/without 1+2 Sorry to give you work, but we don't have a mips machine. Thanks in advance, Zoltán Böszörményi -- Bible has answers for everything. Proof: "But let your communication be, Yea, yea; Nay, nay: for whatsoever is more than these cometh of evil." (Matthew 5:37) - basics of digital technology. "May your kingdom come" - superficial description of plate tectonics ---------------------------------- Zoltán Böszörményi Cybertec Schönig & Schönig GmbH http://www.postgresql.at/
*** pgsql/src/interfaces/ecpg/ecpglib/data.c~ 2010-02-25 13:11:56.000000000 +0100 --- pgsql/src/interfaces/ecpg/ecpglib/data.c 2010-02-25 13:11:56.000000000 +0100 *************** *** 5,10 **** --- 5,11 ---- #include <stdlib.h> #include <string.h> + #include <float.h> #include <math.h> #include "ecpgtype.h"
diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c *** pgsql.orig/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-16 19:56:08.000000000 +0100 --- pgsql/src/interfaces/ecpg/test/expected/pgtypeslib-nan_test.c 2010-02-25 13:16:17.000000000 +0100 *************** *** 9,16 **** #line 1 "nan_test.pgc" #include <stdio.h> #include <stdlib.h> - #include <math.h> #include <float.h> #include <pgtypes_numeric.h> #include <decimal.h> --- 9,16 ---- #line 1 "nan_test.pgc" #include <stdio.h> #include <stdlib.h> #include <float.h> + #include <math.h> #include <pgtypes_numeric.h> #include <decimal.h> diff -dcrpN pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc *** pgsql.orig/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-16 19:56:09.000000000 +0100 --- pgsql/src/interfaces/ecpg/test/pgtypeslib/nan_test.pgc 2010-02-25 13:15:07.000000000 +0100 *************** *** 1,7 **** #include <stdio.h> #include <stdlib.h> - #include <math.h> #include <float.h> #include <pgtypes_numeric.h> #include <decimal.h> --- 1,7 ---- #include <stdio.h> #include <stdlib.h> #include <float.h> + #include <math.h> #include <pgtypes_numeric.h> #include <decimal.h>
*** pgsql.orig/src/interfaces/ecpg/ecpglib/data.c 2010-02-04 11:10:03.000000000 +0100 --- pgsql/src/interfaces/ecpg/ecpglib/data.c 2010-02-25 12:57:49.000000000 +0100 *************** *** 85,94 **** static double get_float8_nan(void) { ! #ifdef NAN ! return (double) NAN; ! #else return (double) (0.0 / 0.0); #endif } --- 85,94 ---- static double get_float8_nan(void) { ! #if !defined(NAN) || (defined(__NetBSD__) && defined(__mips__)) return (double) (0.0 / 0.0); + #else + return (double) NAN; #endif }
-- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers