pgsql: SQL/JSON: Fix error-handling of some JsonBehavior expressions

From: Amit Langote <amitlan(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: SQL/JSON: Fix error-handling of some JsonBehavior expressions
Date: 2024-07-26 07:43:43
Message-ID: E1sXFc7-001Ge7-1k@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

SQL/JSON: Fix error-handling of some JsonBehavior expressions

To ensure that the errors of executing a JsonBehavior expression that
is coerced in the parser are caught instead of being thrown directly,
pass ErrorSaveContext to ExecInitExprRec() when initializing it.
Also, add a EEOP_JSONEXPR_COERCION_FINISH step to handle the errors
that are caught that way.

Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/63e6c5f4a2eeb22e0dd446a62c2b4b417d2b51f0

Modified Files
--------------
src/backend/executor/execExpr.c | 51 +++++++++++++++++++++++-
src/backend/executor/execExprInterp.c | 6 +++
src/test/regress/expected/sqljson_jsontable.out | 6 ++-
src/test/regress/expected/sqljson_queryfuncs.out | 6 ++-
4 files changed, 65 insertions(+), 4 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-07-26 09:19:30 pgsql: Disable all TLS session tickets
Previous Message Amit Langote 2024-07-26 07:43:29 pgsql: SQL/JSON: Improve error-handling of JsonBehavior expressions