pgsql: Reject trailing junk after numeric literals

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Reject trailing junk after numeric literals
Date: 2022-02-16 09:47:55
Message-ID: E1nKGuh-0004Iz-Ph@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Reject trailing junk after numeric literals

After this, the PostgreSQL lexers no longer accept numeric literals
with trailing non-digits, such as 123abc, which would be scanned as
two tokens: 123 and abc. This is undocumented and surprising, and it
might also interfere with some extended numeric literal syntax being
contemplated for the future.

Reviewed-by: John Naylor <john(dot)naylor(at)enterprisedb(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/b239564c-cad0-b23e-c57e-166d883cb97d(at)enterprisedb(dot)com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/2549f0661bd28571d7200d6f82f752a7ee5d47e1

Modified Files
--------------
src/backend/parser/scan.l | 37 +++++++++------
src/fe_utils/psqlscan.l | 31 +++++++------
src/interfaces/ecpg/preproc/pgc.l | 36 ++++++++++-----
src/test/regress/expected/numerology.out | 77 ++++++++++++--------------------
src/test/regress/sql/numerology.sql | 1 -
5 files changed, 96 insertions(+), 86 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Heikki Linnakangas 2022-02-16 10:02:02 pgsql: Fix read beyond buffer bug introduced by the split xlog.c patch.
Previous Message Heikki Linnakangas 2022-02-16 09:15:57 Re: pgsql: Split xlog.c into xlog.c and xlogrecovery.c.