pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)
2+ messages / 1 participants
[nested] [flat]

* pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)
@ 2024-09-12 01:55 Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Amit Langote @ 2024-09-12 01:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)

Currently, when WITH CONDITIONAL WRAPPER is specified, array wrappers
are applied even to a single SQL/JSON item if it is a scalar JSON
value, but this behavior does not comply with the standard.

To fix, apply wrappers only when there are multiple SQL/JSON items
in the result.

Reported-by: Peter Eisentraut <peter@eisentraut.org>
Author: Peter Eisentraut <peter@eisentraut.org>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/8022e067-818b-45d3-8fab-6e0d94d03626%40eisentraut.org
Backpatch-through: 17

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2c27346ed6848b6f5505f1c57078a7c1978ae042

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c            | 24 +++++++++---
src/test/regress/expected/sqljson_queryfuncs.out | 49 +++++++++++-------------
src/test/regress/sql/sqljson_queryfuncs.sql      | 13 +++----
3 files changed, 48 insertions(+), 38 deletions(-)



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

* pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)
@ 2024-09-12 01:55 Amit Langote <amitlan@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Amit Langote @ 2024-09-12 01:55 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER)

Currently, when WITH CONDITIONAL WRAPPER is specified, array wrappers
are applied even to a single SQL/JSON item if it is a scalar JSON
value, but this behavior does not comply with the standard.

To fix, apply wrappers only when there are multiple SQL/JSON items
in the result.

Reported-by: Peter Eisentraut <peter@eisentraut.org>
Author: Peter Eisentraut <peter@eisentraut.org>
Author: Amit Langote <amitlangote09@gmail.com>
Reviewed-by: Andrew Dunstan <andrew@dunslane.net>
Discussion: https://postgr.es/m/8022e067-818b-45d3-8fab-6e0d94d03626%40eisentraut.org
Backpatch-through: 17

Branch
------
master

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

Modified Files
--------------
src/backend/utils/adt/jsonpath_exec.c            | 24 +++++++++---
src/test/regress/expected/sqljson_queryfuncs.out | 49 +++++++++++-------------
src/test/regress/sql/sqljson_queryfuncs.sql      | 13 +++----
3 files changed, 48 insertions(+), 38 deletions(-)



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


end of thread, other threads:[~2024-09-12 01:55 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2024-09-12 01:55 pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER) Amit Langote <amitlan@postgresql.org>
2024-09-12 01:55 pgsql: SQL/JSON: Fix JSON_QUERY(... WITH CONDITIONAL WRAPPER) Amit Langote <amitlan@postgresql.org>

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