SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
authorAmit Langote <amitlan@postgresql.org>
Fri, 6 Sep 2024 04:25:14 +0000 (13:25 +0900)
committerAmit Langote <amitlan@postgresql.org>
Fri, 6 Sep 2024 04:25:53 +0000 (13:25 +0900)
commitbbd4c058a89b1e756eb646af89a4ef90f0df144e
tree087f5ea4c623fed7c8e5466e77d2e2e8e4eca27b
parentee75a03f37fc27c7f07a21dc22edf4511e31a4a1
SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE

Use EMPTY ARRAY instead of EMPTY.

This change does not affect the runtime behavior of JSON_TABLE(),
which continues to return an empty relation ON ERROR. It only alters
whether the default ON ERROR behavior is shown in the deparsed output.

Reported-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 17
src/backend/parser/parse_expr.c
src/backend/utils/adt/ruleutils.c
src/test/regress/expected/sqljson_jsontable.out
src/test/regress/sql/sqljson_jsontable.sql