On Thu, Apr 18, 2024 at 3:51 PM Amit Langote <amit...@postgresql.org> wrote:
> SQL/JSON: Fix issues with DEFAULT .. ON ERROR / EMPTY
>
> SQL/JSON query functions allow specifying an expression to return
> when either of ON ERROR or ON EMPTY condition occurs when evaluating
> the JSON path expression.  The parser (transformJsonBehavior()) checks
> that the specified expression is one of the supported expressions, but
> there are two issues with how the check is done that are fixed in this
> commit:
>
> * No check for some expressions related to coercion, such as
>   CoerceViaIO, that may appear in the transformed user-specified
>   expressions that include cast(s)
>
> * An unsupported expression may be masked by a coercion-related
>   expression, which must be flagged by checking the latter's
>   argument expression recursively
>
> Author: Jian He <jian.universal...@gmail.com>
> Author: Amit Langote <amitlangot...@gmail.com>
> Reported-by: Jian He <jian.universal...@gmail.com>
> Discussion: 
> https://postgr.es/m/cacjufxeqhqsfrg_p7emyo5zak3d767ifdl8vz_4%3dzbhpotr...@mail.gmail.com
> Discussion: 
> https://postgr.es/m/cacjufxgoerh1qjknm1noh-kz5fqu4p7qfezsevt2tn_4slx...@mail.gmail.com
>
> Branch
> ------
> master
>
> Details
> -------
> https://git.postgresql.org/pg/commitdiff/c0fc0751862d4e9b7ca9d51f2cd79344690ec873
>
> Modified Files
> --------------
> src/backend/parser/parse_expr.c                  | 37 ++++++++++++++-
> src/test/regress/expected/sqljson_jsontable.out  | 32 +++++++++++++
> src/test/regress/expected/sqljson_queryfuncs.out | 57 ++++++++++++++++++++++++
> src/test/regress/sql/sqljson_jsontable.sql       | 16 +++++++
> src/test/regress/sql/sqljson_queryfuncs.sql      | 27 +++++++++++
> 5 files changed, 167 insertions(+), 2 deletions(-)

Noticed failures on canebrake and urutu that seem to have to do with
using the same DOMAIN name in nearby test files causing a clash.

Will push a fix shortly.

-- 
Thanks, Amit Langote


Reply via email to