Fix PL/pgSQL's handling of integer ranges containing underscores.
Dean Rasheed <dean.a.rasheed@gmail.com>
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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/parser/scan.l | modified | +1 −1 |
| src/fe_utils/psqlscan.l | modified | +1 −1 |
| src/interfaces/ecpg/preproc/pgc.l | modified | +1 −1 |
| src/test/regress/expected/numerology.out | modified | +11 −0 |
| src/test/regress/sql/numerology.sql | modified | +9 −0 |
Discussion
- plpgsql: fix parsing of integer range with underscores 4 messages · 2024-05-15 → 2024-06-04