Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit21e8d2a

Browse files
author
Nikita Glukhov
committed
Use nodes JsonFomat and JsonReturning in JsonCtorExpr
1 parentcb80df9 commit21e8d2a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

‎src/backend/parser/gram.y

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14696,15 +14696,15 @@ json_func_expr:
1469614696
json_value_expr:
1469714697
a_expr json_format_clause_opt
1469814698
{
14699-
$$ = (Node *)makeJsonValueExpr((Expr *) $1,$2);
14699+
$$ = (Node *)makeJsonValueExpr((Expr *) $1,castNode(JsonFormat, $2));
1470014700
}
1470114701
;
1470214702

1470314703
json_format_clause_opt:
1470414704
FORMAT json_representation
1470514705
{
1470614706
$$ = $2;
14707-
$$.location = @1;
14707+
castNode(JsonFormat, $$)->location = @1;
1470814708
}
1470914709
|/* EMPTY*/
1471014710
{
@@ -14734,7 +14734,8 @@ json_output_clause_opt:
1473414734
{
1473514735
JsonOutput *n =makeNode(JsonOutput);
1473614736
n->typeName = $2;
14737-
n->returning.format = $3;
14737+
n->returning =makeNode(JsonReturning);
14738+
n->returning->format = (JsonFormat *) $3;
1473814739
$$ = (Node *) n;
1473914740
}
1474014741
|/* EMPTY*/{ $$ =NULL; }

‎src/include/nodes/parsenodes.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1496,7 +1496,7 @@ typedef struct JsonOutput
14961496
{
14971497
NodeTagtype;
14981498
TypeName*typeName;/* RETURNING type name, if specified */
1499-
JsonReturningreturning;/* RETURNING FORMAT clause and type Oids */
1499+
JsonReturning*returning;/* RETURNING FORMAT clause and type Oids */
15001500
}JsonOutput;
15011501

15021502
/*
@@ -1547,7 +1547,7 @@ typedef struct JsonArrayQueryCtor
15471547
NodeTagtype;
15481548
Node*query;/* subquery */
15491549
JsonOutput*output;/* RETURNING clause, if specified */
1550-
JsonFormatformat;/* FORMAT clause for subquery, if specified */
1550+
JsonFormat*format;/* FORMAT clause for subquery, if specified */
15511551
boolabsent_on_null;/* skip NULL elements? */
15521552
intlocation;/* token location, or -1 if unknown */
15531553
}JsonArrayQueryCtor;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp