Re-forbid underscore in positional parameters
authorPeter Eisentraut <[email protected]>
Wed, 15 May 2024 11:49:41 +0000 (13:49 +0200)
committerPeter Eisentraut <[email protected]>
Wed, 15 May 2024 11:49:41 +0000 (13:49 +0200)
commit98b4f53d156efe09294d6e1d62a5b52f544eee29
tree573d1ae864f9e855104dfc1c55850baea079b7e5
parent96bc29edfde9b8ad0de573702a6b1c55f73ce912
Re-forbid underscore in positional parameters

Underscores were added to numeric literals in faff8f8e47.  This change
also affected the positional parameters (e.g., $1) rule, which uses
the same production for its digits.  But this did not actually work,
because the digits for parameters are processed using atol(), which
does not handle underscores and ignores whatever it cannot parse.

The underscores notation is probably not useful for positional
parameters, so for simplicity revert that rule to its old form that
only accepts digits 0-9.

Author: Erik Wienhold <[email protected]>
Reviewed-by: Michael Paquier <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/5d216d1c-91f6-4cbe-95e2-b4cbd930520c%40ewie.name
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