Commit 6822285
committed
SQL/JSON: Fix JSON_TABLE() column deparsing
The deparsing code in get_json_expr_options() unnecessarily emitted
the default column-specific ON ERROR / EMPTY behavior when the
top-level ON ERROR behavior in JSON_TABLE was set to ERROR. Fix that
by not overriding the column-specific default, determined based on
the column's JsonExprOp in get_json_table_columns(), with
JSON_BEHAVIOR_ERROR when that is the top-level ON ERROR behavior.
Note that this only removes redundancy; the current deparsing output
is not incorrect, just redundant.
Reviewed-by: Jian He <jian.universality@gmail.com>
Discussion: https://postgr.es/m/CACJufxEo4sUjKCYtda0_qt9tazqqKPmF1cqhW9KBOUeJFqQd2g@mail.gmail.com
Backpatch-through: 171 parent 3422f5f commit 6822285
File tree
3 files changed
+27
-4
lines changed- src
- backend/utils/adt
- test/regress
- expected
- sql
3 files changed
+27
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11719 | 11719 | | |
11720 | 11720 | | |
11721 | 11721 | | |
11722 | | - | |
11723 | 11722 | | |
11724 | 11723 | | |
11725 | 11724 | | |
| |||
11772 | 11771 | | |
11773 | 11772 | | |
11774 | 11773 | | |
| 11774 | + | |
| 11775 | + | |
| 11776 | + | |
| 11777 | + | |
11775 | 11778 | | |
11776 | 11779 | | |
11777 | 11780 | | |
| |||
11795 | 11798 | | |
11796 | 11799 | | |
11797 | 11800 | | |
11798 | | - | |
11799 | | - | |
11800 | | - | |
11801 | 11801 | | |
11802 | 11802 | | |
11803 | 11803 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1132 | 1132 | | |
1133 | 1133 | | |
1134 | 1134 | | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
| 1144 | + | |
| 1145 | + | |
| 1146 | + | |
| 1147 | + | |
| 1148 | + | |
| 1149 | + | |
| 1150 | + | |
| 1151 | + | |
| 1152 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
542 | 542 | | |
543 | 543 | | |
544 | 544 | | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
0 commit comments