Re: 8.2beta1 failure on IRIX

From: Steve Singer <ssinger_pg(at)sympatico(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: 8.2beta1 failure on IRIX
Date: 2006-10-06 03:37:30
Message-ID: BAYC1-PASMTP01FAD5F98ECFCC594CFD87AC130@CEZ.ICE
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, 4 Oct 2006, Tom Lane wrote:

I've applied the patch and it seems to fix the problems.

8.2beta1 + the patch passes all of the regression tests on the IRIX box
(accept the expected difference with the geometry test).

> I've applied the attached patch which merges ideas from your version and
> John Jorgensen's. Please check it.
>
> regards, tom lane
>
> *** src/backend/utils/adt/float.c.orig Tue Oct 3 23:16:36 2006
> --- src/backend/utils/adt/float.c Wed Oct 4 21:21:17 2006
> ***************
> *** 328,333 ****
> --- 328,359 ----
> }
> #endif /* HAVE_BUGGY_SOLARIS_STRTOD */
>
> + #ifdef HAVE_BUGGY_IRIX_STRTOD
> + /*
> + * In some IRIX versions, strtod() recognizes only "inf", so if the
> + * input is "infinity" we have to skip over "inity". Also, it may
> + * return positive infinity for "-inf".
> + */
> + if (isinf(val))
> + {
> + if (pg_strncasecmp(num, "Infinity", 8) == 0)
> + {
> + val = get_float4_infinity();
> + endptr = num + 8;
> + }
> + else if (pg_strncasecmp(num, "-Infinity", 9) == 0)
> + {
> + val = -get_float4_infinity();
> + endptr = num + 9;
> + }
> + else if (pg_strncasecmp(num, "-inf", 4) == 0)
> + {
> + val = -get_float4_infinity();
> + endptr = num + 4;
> + }
> + }
> + #endif /* HAVE_BUGGY_IRIX_STRTOD */
> +
> /* skip trailing whitespace */
> while (*endptr != '\0' && isspace((unsigned char) *endptr))
> endptr++;
> ***************
> *** 494,499 ****
> --- 520,551 ----
> endptr--;
> }
> #endif /* HAVE_BUGGY_SOLARIS_STRTOD */
> +
> + #ifdef HAVE_BUGGY_IRIX_STRTOD
> + /*
> + * In some IRIX versions, strtod() recognizes only "inf", so if the
> + * input is "infinity" we have to skip over "inity". Also, it may
> + * return positive infinity for "-inf".
> + */
> + if (isinf(val))
> + {
> + if (pg_strncasecmp(num, "Infinity", 8) == 0)
> + {
> + val = get_float8_infinity();
> + endptr = num + 8;
> + }
> + else if (pg_strncasecmp(num, "-Infinity", 9) == 0)
> + {
> + val = -get_float8_infinity();
> + endptr = num + 9;
> + }
> + else if (pg_strncasecmp(num, "-inf", 4) == 0)
> + {
> + val = -get_float8_infinity();
> + endptr = num + 4;
> + }
> + }
> + #endif /* HAVE_BUGGY_IRIX_STRTOD */
>
> /* skip trailing whitespace */
> while (*endptr != '\0' && isspace((unsigned char) *endptr))
> *** src/include/port/irix.h.orig Fri Mar 10 23:38:38 2006
> --- src/include/port/irix.h Wed Oct 4 21:20:50 2006
> ***************
> *** 1 ****
> --- 1,7 ----
> /* $PostgreSQL: pgsql/src/include/port/irix.h,v 1.3 2006/03/11 04:38:38 momjian Exp $ */
> +
> + /*
> + * IRIX 6.5.26f and 6.5.22f (at least) have a strtod() that accepts
> + * "infinity", but leaves endptr pointing to "inity".
> + */
> + #define HAVE_BUGGY_IRIX_STRTOD
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Pavel Stehule 2006-10-06 06:47:04 Re: PL/pgSQL Todo, better information in errcontext from plpgsql
Previous Message Jim Nasby 2006-10-06 03:27:11 Re: timetz storage vs timestamptz