pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl 2+ messages / 1 participants [nested] [flat]
* pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl @ 2025-01-12 13:39 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 2+ messages in thread From: Dean Rasheed @ 2025-01-12 13:39 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix JsonExpr deparsing to quote variable names in the PASSING clause. When deparsing a JsonExpr, variable names in the PASSING clause were not quoted. However, since they are parsed as ColLabel tokens, some variable names require double quotes to ensure that they are properly interpreted. Fix by using quote_identifier() in the deparsing code. This oversight was limited to the SQL/JSON query functions JSON_EXISTS(), JSON_QUERY(), and JSON_VALUE(). Back-patch to v17, where these functions were added. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCXTpAS%3DncfLNTZ7YS6O5puHeLg_SUYAit%2Bcs7wsrd9Msg%40mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/a93e2a1e25a6d5410abb1446637c4d9a4f24e35d Modified Files -------------- src/backend/utils/adt/ruleutils.c | 2 +- src/test/regress/expected/sqljson_queryfuncs.out | 20 +++++++++++++++++--- src/test/regress/sql/sqljson_queryfuncs.sql | 5 ++++- 3 files changed, 22 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl @ 2025-01-12 13:39 Dean Rasheed <dean.a.rasheed@gmail.com> 0 siblings, 0 replies; 2+ messages in thread From: Dean Rasheed @ 2025-01-12 13:39 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Fix JsonExpr deparsing to quote variable names in the PASSING clause. When deparsing a JsonExpr, variable names in the PASSING clause were not quoted. However, since they are parsed as ColLabel tokens, some variable names require double quotes to ensure that they are properly interpreted. Fix by using quote_identifier() in the deparsing code. This oversight was limited to the SQL/JSON query functions JSON_EXISTS(), JSON_QUERY(), and JSON_VALUE(). Back-patch to v17, where these functions were added. Dean Rasheed, reviewed by Tom Lane. Discussion: https://postgr.es/m/CAEZATCXTpAS%3DncfLNTZ7YS6O5puHeLg_SUYAit%2Bcs7wsrd9Msg%40mail.gmail.com Branch ------ REL_17_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d037cc2af14ae59f0d1d0cfae826a2c7b0aa1a37 Modified Files -------------- src/backend/utils/adt/ruleutils.c | 2 +- src/test/regress/expected/sqljson_queryfuncs.out | 20 +++++++++++++++++--- src/test/regress/sql/sqljson_queryfuncs.sql | 5 ++++- 3 files changed, 22 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2025-01-12 13:39 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2025-01-12 13:39 pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl Dean Rasheed <dean.a.rasheed@gmail.com> 2025-01-12 13:39 pgsql: Fix JsonExpr deparsing to quote variable names in the PASSING cl 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