Re: Non-decimal integer literals

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Non-decimal integer literals
Дата
Msg-id CAEZATCU0E8sRPf=P-vqYNoMEn7d-_wsy4jUKVOuoPqjOaoGNhA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On Tue, 22 Nov 2022 at 13:37, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
>
> On 15.11.22 11:31, Peter Eisentraut wrote:
> > On 14.11.22 08:25, John Naylor wrote:
> >> Regarding the patch, it looks good overall. My only suggestion would
> >> be to add a regression test for just below and just above overflow, at
> >> least for int2.
> >
> This was a valuable suggestion, because this found some breakage.  In
> particular, the handling of grammar-level literals that overflow to
> "Float" was not correct.  (The radix prefix was simply stripped and
> forgotten.)  So I added a bunch more tests for this.  Here is a new patch.

Taking a quick look, I noticed that there are no tests for negative
values handled in the parser.

Giving that a spin shows that make_const() fails to correctly identify
the base of negative non-decimal integers in the T_Float case, causing
it to fall through to numeric_in() and fail:

SELECT -0x80000000;

ERROR:  invalid input syntax for type numeric: "-0x80000000"
               ^
Regards,
Dean



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Prefetch the next tuple's memory during seqscans
Следующее
От: Greg Stark
Дата:
Сообщение: Re: pgsql: Prevent instability in contrib/pageinspect's regression test.