pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Dean Rasheed <dean.a.rasheed@gmail.com>
Cc: John Naylor <john.naylor@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Non-decimal integer literals
Date: Wed, 14 Dec 2022 06:47:28 +0100
Message-ID: <6e7d5b72-eaa6-e481-71d4-61a0a057949c@enterprisedb.com> (raw )
In-Reply-To: <404b6297-a22f-afea-cdcb-848543c39193@enterprisedb.com >
References: <b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com >
<CA+TgmoZv2Q11P1JbF+ziu1b8vsBpcjfPqXsHMR0hJqSTeLP1xQ@mail.gmail.com >
<bef9c869-e773-f792-fde2-d7555add2879@enterprisedb.com >
<CA+TgmoZRJzBe6yKeBpQ2auHndeV-bzygSY=gr0A0KixZ2giKNg@mail.gmail.com >
<2317133.1643155358@sss.pgh.pa.us >
<97aa22d7-b80f-efa1-f368-3dbf73a15980@enterprisedb.com >
<CAFBsxsGcgqJ_KO-1=jCUJKK2z5rCh2qsf7=VgNWzTvakLMDyBQ@mail.gmail.com >
<bc462aff-675b-86e2-46e3-7eaf5ce3e75f@enterprisedb.com >
<071c40f2-15cf-5db3-8799-dbac041bb881@enterprisedb.com >
<CAFBsxsG4m9qK=vyLAj2DGo3vZ6AC0vRxA4gWtExH5RGP=sPo_Q@mail.gmail.com >
<b70b15fc-7f8d-5370-21fc-4ec3c154aef3@enterprisedb.com >
<791aee01-f488-0706-2694-08c5b57a3bdd@enterprisedb.com >
<CAEZATCU0E8sRPf=P-vqYNoMEn7d-_wsy4jUKVOuoPqjOaoGNhA@mail.gmail.com >
<164fea20-dae9-d0fb-9917-772cd0068d29@enterprisedb.com >
<CAApHDvqPHHxbXmqpvzCbQeSmhxYEgbnNTfXt=kA=aK4A3TtTQA@mail.gmail.com >
<404b6297-a22f-afea-cdcb-848543c39193@enterprisedb.com >
On 08.12.22 12:16, Peter Eisentraut wrote:
> 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. ;-)
committed
view thread (62+ messages) latest in thread
Message-ID: <6e7d5b72-eaa6-e481-71d4-61a0a057949c@enterprisedb.com>
Permalink: ../6e7d5b72-eaa6-e481-71d4-61a0a057949c@enterprisedb.com/
Also on: postgresql.org/message-id/6e7d5b72-eaa6-e481-71d4-61a0a057949c@enterprisedb.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: peter.eisentraut@enterprisedb.com, dgrowleyml@gmail.com, dean.a.rasheed@gmail.com, john.naylor@enterprisedb.com
Subject: Re: Non-decimal integer literals
In-Reply-To: <6e7d5b72-eaa6-e481-71d4-61a0a057949c@enterprisedb.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox