Reject trailing junk after numeric literals
commit2549f0661bd28571d7200d6f82f752a7ee5d47e1
authorPeter Eisentraut <peter@eisentraut.org>
Wed, 16 Feb 2022 09:32:36 +0000 (16 10:32 +0100)
committerPeter Eisentraut <peter@eisentraut.org>
Wed, 16 Feb 2022 09:37:31 +0000 (16 10:37 +0100)
tree04e905d232763697d1a94cc4cc69c0154ca31372
parent70e81861fadd9112fa2d425c762e163910a4ee52
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: https://www.postgresql.org/message-id/flat/b239564c-cad0-b23e-c57e-166d883cb97d@enterprisedb.com
src/backend/parser/scan.l
src/fe_utils/psqlscan.l
src/interfaces/ecpg/preproc/pgc.l
src/test/regress/expected/numerology.out
src/test/regress/sql/numerology.sql