File tree Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Expand file tree Collapse file tree 3 files changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -14265,7 +14265,7 @@ json_table_column_definition:
14265
14265
}
14266
14266
| ColId Typename
14267
14267
EXISTS json_table_column_path_clause_opt
14268
- json_behavior_clause_opt
14268
+ json_on_error_clause_opt
14269
14269
{
14270
14270
JsonTableColumn *n = makeNode(JsonTableColumn);
14271
14271
@@ -14276,8 +14276,8 @@ json_table_column_definition:
14276
14276
n->wrapper = JSW_NONE;
14277
14277
n->quotes = JS_QUOTES_UNSPEC;
14278
14278
n->pathspec = (JsonTablePathSpec *) $4 ;
14279
- n->on_empty = (JsonBehavior *) linitial( $5 ) ;
14280
- n->on_error = (JsonBehavior *) lsecond( $5 ) ;
14279
+ n->on_empty = NULL ;
14280
+ n->on_error = (JsonBehavior *) $5 ;
14281
14281
n->location = @1 ;
14282
14282
$$ = (Node *) n;
14283
14283
}
Original file line number Diff line number Diff line change @@ -1067,3 +1067,8 @@ CREATE OR REPLACE VIEW public.jsonb_table_view7 AS
1067
1067
) sub
1068
1068
DROP VIEW jsonb_table_view7;
1069
1069
DROP TABLE s;
1070
+ -- Prevent ON EMPTY specification on EXISTS columns
1071
+ SELECT * FROM JSON_TABLE(jsonb '1', '$' COLUMNS (a int exists empty object on empty));
1072
+ ERROR: syntax error at or near "empty"
1073
+ LINE 1: ...sonb '1', '$' COLUMNS (a int exists empty object on empty));
1074
+ ^
Original file line number Diff line number Diff line change @@ -518,3 +518,6 @@ SELECT sub.* FROM s,
518
518
\sv jsonb_table_view7
519
519
DROP VIEW jsonb_table_view7;
520
520
DROP TABLE s;
521
+
522
+ -- Prevent ON EMPTY specification on EXISTS columns
523
+ SELECT * FROM JSON_TABLE(jsonb ' 1' , ' $' COLUMNS (a int exists empty object on empty));
You can’t perform that action at this time.
0 commit comments