SQL/JSON: Fix default ON ERROR behavior for JSON_TABLE
authorAmit Langote
Fri, 6 Sep 2024 01:13:03 +0000 (10:13 +0900)
committerAmit Langote
Fri, 6 Sep 2024 03:01:49 +0000 (12:01 +0900)
commit5067c230b8ee42a01cc77dc5745bc3a78f393af3
tree21bb2621cf5e39afc68a55a701f60059e409abc1
parentc88ce386c4d7bfeb437ff31ec7c23c392c862e77
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
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