Re: Non-decimal integer literals

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: Non-decimal integer literals
Дата
Msg-id CAApHDvqPHHxbXmqpvzCbQeSmhxYEgbnNTfXt=kA=aK4A3TtTQA@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Ответы Re: Non-decimal integer literals
Список pgsql-hackers
On Tue, 29 Nov 2022 at 03:00, Peter Eisentraut
<peter.eisentraut@enterprisedb.com> wrote:
> Fixed in new patch.

There seems to be a small bug in the pg_strtointXX functions in the
code that checks that there's at least 1 digit.  This causes 0x to be
a valid representation of zero.  That does not seem to be allowed by
the parser, so I think we should likely reject it in COPY too.

-- Does not work.
postgres=# select 0x + 1;
ERROR:  invalid hexadecimal integer at or near "0x"
LINE 1: select 0x + 1;


postgres=# create table a (a int);
CREATE TABLE

-- probably shouldn't work
postgres=# copy a from stdin;
Enter data to be copied followed by a newline.
End with a backslash and a period on a line by itself, or an EOF signal.
>> 0x
>> \.
COPY 1

David



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

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: Collation version tracking for macOS
Следующее
От: Daniel Gustafsson
Дата:
Сообщение: Re: User functions for building SCRAM secrets