pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Re-forbid underscore in positional parameters
Date: Wed, 15 May 2024 11:57:18 +0000
Message-ID: <E1s7DG2-000Khj-CF@gemulon.postgresql.org> (raw)

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 <ewie@ewie.name>
Reviewed-by: Michael Paquier <michael@paquier.xyz>
Discussion: https://www.postgresql.org/message-id/flat/5d216d1c-91f6-4cbe-95e2-b4cbd930520c%40ewie.name

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/98b4f53d156efe09294d6e1d62a5b52f544eee29

Modified Files
--------------
src/backend/parser/scan.l                | 5 +++--
src/fe_utils/psqlscan.l                  | 5 +++--
src/interfaces/ecpg/preproc/pgc.l        | 5 +++--
src/test/regress/expected/numerology.out | 4 ++++
src/test/regress/sql/numerology.sql      | 1 +
5 files changed, 14 insertions(+), 6 deletions(-)



view thread (2+ messages)  latest in thread

Message-ID: <E1s7DG2-000Khj-CF@gemulon.postgresql.org>
Permalink:  ../E1s7DG2-000Khj-CF@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1s7DG2-000Khj-CF@gemulon.postgresql.org

 · 

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-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Re-forbid underscore in positional parameters
  In-Reply-To: <E1s7DG2-000Khj-CF@gemulon.postgresql.org>

* 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