Re: Non-decimal integer literals

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: Non-decimal integer literals
Дата
Msg-id 404b6297-a22f-afea-cdcb-848543c39193@enterprisedb.com
обсуждение исходный текст
Ответ на Re: Non-decimal integer literals  (David Rowley <dgrowleyml@gmail.com>)
Ответы Re: Non-decimal integer literals  (Peter Eisentraut <peter.eisentraut@enterprisedb.com>)
Список pgsql-hackers
On 29.11.22 21:22, David Rowley wrote:
> 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.
> -- 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

Fixed in new patch.  I moved the "require at least one digit" checks 
after the loops over the digits, to make it easier to write one check 
for all bases.

This patch is also incorporates your changes to the digit analysis 
algorithm.  I didn't check it carefully, but all the tests still pass. ;-)

Вложения

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

Предыдущее
От: Pavel Luzanov
Дата:
Сообщение: Re: fix and document CLUSTER privileges
Следующее
От: Melih Mutlu
Дата:
Сообщение: Re: [PATCH] psql: Add tab-complete for optional view parameters