pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix PL/pgSQL's handling of integer ranges containing underscores
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix PL/pgSQL's handling of integer ranges containing underscores
@ 2024-06-04 10:54  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dean Rasheed @ 2024-06-04 10:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix PL/pgSQL's handling of integer ranges containing underscores.

Commit faff8f8e47 allowed integer literals to contain underscores, but
failed to update the lexer's "numericfail" rule. As a result, a
decimal integer literal containing underscores would fail to parse, if
used in an integer range with no whitespace after the first number,
such as "1_001..1_003" in a PL/pgSQL FOR loop.

Fix and backpatch to v16, where support for underscores in integer
literals was added.

Report and patch by Erik Wienhold.

Discussion: https://postgr.es/m/808ce947-46ec-4628-85fa-3dd600b2c154%40ewie.name

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/cd2624fd97b0c36b68da278abc5362647f69b07d

Modified Files
--------------
src/backend/parser/scan.l                |  2 +-
src/fe_utils/psqlscan.l                  |  2 +-
src/interfaces/ecpg/preproc/pgc.l        |  2 +-
src/test/regress/expected/numerology.out | 11 +++++++++++
src/test/regress/sql/numerology.sql      |  9 +++++++++
5 files changed, 23 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix PL/pgSQL's handling of integer ranges containing underscores
@ 2024-06-04 10:54  Dean Rasheed <dean.a.rasheed@gmail.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Dean Rasheed @ 2024-06-04 10:54 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

Fix PL/pgSQL's handling of integer ranges containing underscores.

Commit faff8f8e47 allowed integer literals to contain underscores, but
failed to update the lexer's "numericfail" rule. As a result, a
decimal integer literal containing underscores would fail to parse, if
used in an integer range with no whitespace after the first number,
such as "1_001..1_003" in a PL/pgSQL FOR loop.

Fix and backpatch to v16, where support for underscores in integer
literals was added.

Report and patch by Erik Wienhold.

Discussion: https://postgr.es/m/808ce947-46ec-4628-85fa-3dd600b2c154%40ewie.name

Branch
------
REL_16_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/b4e909082fa114d5934ca622b225d2352ec639fa

Modified Files
--------------
src/backend/parser/scan.l                |  2 +-
src/fe_utils/psqlscan.l                  |  2 +-
src/interfaces/ecpg/preproc/pgc.l        |  2 +-
src/test/regress/expected/numerology.out | 11 +++++++++++
src/test/regress/sql/numerology.sql      |  9 +++++++++
5 files changed, 23 insertions(+), 3 deletions(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2024-06-04 10:54 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-06-04 10:54 pgsql: Fix PL/pgSQL's handling of integer ranges containing underscores Dean Rasheed <dean.a.rasheed@gmail.com>
2024-06-04 10:54 pgsql: Fix PL/pgSQL's handling of integer ranges containing underscores Dean Rasheed <dean.a.rasheed@gmail.com>

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