Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented

Поиск
Список
Период
Сортировка
От John Naylor
Тема Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented
Дата
Msg-id CAFBsxsFZvq=z75Y+bMZQdZ5HbMxdjQ2fhSs=Y+nNb5tt9taPdw@mail.gmail.com
обсуждение исходный текст
Ответ на Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs

On Fri, Jul 30, 2021 at 11:14 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> John Naylor <john.naylor@enterprisedb.com> writes:
> > On Fri, Jul 30, 2021 at 7:53 AM PG Bug reporting form <
> > noreply@postgresql.org> wrote:
> >> -   if (l < -INT_MAX || l > INT_MAX)
> >> +   if (l < (-INT_MAX - 1) || l > INT_MAX)
>
> > Yeah, that looks like it should be INT_MIN instead. I'll see about making
> > that happen. Thanks for the report!
>
> The whole stanza perhaps ought to be within
>
> #if SIZEOF_LONG > SIZEOF_INT
>
> otherwise some compilers will bleat about useless tests.

Here's a draft fix for master, with regression tests. It will need a bit of massaging for the back branches -- the problem goes back at least to 9.6.

--
John Naylor
EDB: http://www.enterprisedb.com
Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17128: minimum numeric 'integer' is -2147483647 not -2147483648 as documented