Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)
Дата
Msg-id 21278.1328120266@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)  (Marti Raudsepp <marti@juffo.org>)
Ответы Re: [PATCH] Fix float8 parsing of denormal values (on some platforms?)  (Marti Raudsepp <marti@juffo.org>)
Список pgsql-hackers
Marti Raudsepp <marti@juffo.org> writes:
> On Wed, Dec 21, 2011 at 18:21, Marti Raudsepp <marti@juffo.org> wrote:
>> I think the least invasive fix, as proposed by Jeroen, is to fail only
>> when ERANGE is set *and* the return value is 0.0 or +/-HUGE_VAL.
>> Reading relevant specifications, this seems to be a fairly safe
>> assumption. That's what the attached patch does.

> Oops, now attached the patch too.

Applied with minor revisions.  Notably, after staring at the code a bit
I got uncomfortable with its assumption that pg_strncasecmp() cannot
change errno, so I fixed it to not assume that.  Also, on some platforms
HUGE_VAL isn't infinity but the largest finite value, so I made the
range tests be like ">= HUGE_VAL" not just "== HUGE_VAL".  I know the
man page for strtod() specifies it should return exactly HUGE_VAL for
overflow, but who's to say that <math.h> is on the same page as the
actual function?
        regards, tom lane


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Re: disable prompting by default in createuser
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: psql case preserving completion