Re: 8.0.0beta1: make check fails on solaris8

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Martin Münstermann <mmuenstermann(at)betrusted(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: 8.0.0beta1: make check fails on solaris8
Date: 2004-08-11 13:36:30
Message-ID: 4673.1092231390@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?ISO-8859-15?Q?Martin_M=FCnstermann?= <mmuenstermann(at)betrusted(dot)com> writes:
> It's even a little more bizarre:
> When I start a fresh psql session, SELECT 'infinity'::float4 just works.
> Then I \i sql/float4.sql, and after that
> template1=# \set VERBOSITY verbose
> template1=# SELECT 'infinity'::float4;
> ERROR: 22P02: invalid input syntax for type real: "infinity"
> LOCATION: float4in, float.c:330

Wow. Well, that confirms my suspicion that endptr is bad --- the line
number shows that the complaint is coming from the
junk-at-end-of-the-string test. But why is it history-dependent?

I wonder if endptr might not be getting set at all in this case.
Could you try adding "endptr = num;" to the code in
src/backend/utils/adt/float.c, that is

/* skip leading whitespace */
while (*num != '\0' && isspace((unsigned char) *num))
num++;

+ endptr = num;
errno = 0;
val = strtod(num, &endptr);

/* did we not see anything that looks like a double? */

at about line 280, and similarly at line 445. Does that make it
any better?

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2004-08-11 14:03:24 broken bug-report web form
Previous Message Andras Kutrovics 2004-08-11 12:33:03 PostgreSQL 8.0