pgsql: Reject trailing junk after numeric literals

Started by Peter Eisentrautover 4 years ago1 messagescomitters
Jump to latest
#1Peter Eisentraut
peter_e@gmx.net

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.naylor@enterprisedb.com>
Discussion: /messages/by-id/b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.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(-)