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

Commit1460fc5

Browse files
committed
Revert "Common SQL/JSON clauses"
This reverts commit865fe4d.This has caused issues with a significant number of buildfarm members
1 parent3707e43 commit1460fc5

File tree

17 files changed

+2
-758
lines changed

17 files changed

+2
-758
lines changed

‎src/backend/executor/execExpr.c

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2428,28 +2428,6 @@ ExecInitExprRec(Expr *node, ExprState *state,
24282428
break;
24292429
}
24302430

2431-
caseT_JsonValueExpr:
2432-
{
2433-
JsonValueExpr*jve= (JsonValueExpr*)node;
2434-
2435-
ExecInitExprRec(jve->raw_expr,state,resv,resnull);
2436-
2437-
if (jve->formatted_expr)
2438-
{
2439-
Datum*innermost_caseval=state->innermost_caseval;
2440-
bool*innermost_isnull=state->innermost_casenull;
2441-
2442-
state->innermost_caseval=resv;
2443-
state->innermost_casenull=resnull;
2444-
2445-
ExecInitExprRec(jve->formatted_expr,state,resv,resnull);
2446-
2447-
state->innermost_caseval=innermost_caseval;
2448-
state->innermost_casenull=innermost_isnull;
2449-
}
2450-
break;
2451-
}
2452-
24532431
default:
24542432
elog(ERROR,"unrecognized node type: %d",
24552433
(int)nodeTag(node));

‎src/backend/nodes/copyfuncs.c

Lines changed: 0 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -2298,52 +2298,6 @@ _copyOnConflictExpr(const OnConflictExpr *from)
22982298
returnnewnode;
22992299
}
23002300

2301-
2302-
/*
2303-
* _copyJsonFormat
2304-
*/
2305-
staticJsonFormat*
2306-
_copyJsonFormat(constJsonFormat*from)
2307-
{
2308-
JsonFormat*newnode=makeNode(JsonFormat);
2309-
2310-
COPY_SCALAR_FIELD(format_type);
2311-
COPY_SCALAR_FIELD(encoding);
2312-
COPY_LOCATION_FIELD(location);
2313-
2314-
returnnewnode;
2315-
}
2316-
2317-
/*
2318-
* _copyJsonReturning
2319-
*/
2320-
staticJsonReturning*
2321-
_copyJsonReturning(constJsonReturning*from)
2322-
{
2323-
JsonReturning*newnode=makeNode(JsonReturning);
2324-
2325-
COPY_NODE_FIELD(format);
2326-
COPY_SCALAR_FIELD(typid);
2327-
COPY_SCALAR_FIELD(typmod);
2328-
2329-
returnnewnode;
2330-
}
2331-
2332-
/*
2333-
* _copyJsonValueExpr
2334-
*/
2335-
staticJsonValueExpr*
2336-
_copyJsonValueExpr(constJsonValueExpr*from)
2337-
{
2338-
JsonValueExpr*newnode=makeNode(JsonValueExpr);
2339-
2340-
COPY_NODE_FIELD(raw_expr);
2341-
COPY_NODE_FIELD(formatted_expr);
2342-
COPY_NODE_FIELD(format);
2343-
2344-
returnnewnode;
2345-
}
2346-
23472301
/* ****************************************************************
23482302
*pathnodes.h copy functions
23492303
*
@@ -5396,15 +5350,6 @@ copyObjectImpl(const void *from)
53965350
caseT_OnConflictExpr:
53975351
retval=_copyOnConflictExpr(from);
53985352
break;
5399-
caseT_JsonFormat:
5400-
retval=_copyJsonFormat(from);
5401-
break;
5402-
caseT_JsonReturning:
5403-
retval=_copyJsonReturning(from);
5404-
break;
5405-
caseT_JsonValueExpr:
5406-
retval=_copyJsonValueExpr(from);
5407-
break;
54085353

54095354
/*
54105355
* RELATION NODES

‎src/backend/nodes/equalfuncs.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -841,36 +841,6 @@ _equalOnConflictExpr(const OnConflictExpr *a, const OnConflictExpr *b)
841841
return true;
842842
}
843843

844-
staticbool
845-
_equalJsonFormat(constJsonFormat*a,constJsonFormat*b)
846-
{
847-
COMPARE_SCALAR_FIELD(format_type);
848-
COMPARE_SCALAR_FIELD(encoding);
849-
COMPARE_LOCATION_FIELD(location);
850-
851-
return true;
852-
}
853-
854-
staticbool
855-
_equalJsonReturning(constJsonReturning*a,constJsonReturning*b)
856-
{
857-
COMPARE_NODE_FIELD(format);
858-
COMPARE_SCALAR_FIELD(typid);
859-
COMPARE_SCALAR_FIELD(typmod);
860-
861-
return true;
862-
}
863-
864-
staticbool
865-
_equalJsonValueExpr(constJsonValueExpr*a,constJsonValueExpr*b)
866-
{
867-
COMPARE_NODE_FIELD(raw_expr);
868-
COMPARE_NODE_FIELD(formatted_expr);
869-
COMPARE_NODE_FIELD(format);
870-
871-
return true;
872-
}
873-
874844
/*
875845
* Stuff from pathnodes.h
876846
*/
@@ -3388,15 +3358,6 @@ equal(const void *a, const void *b)
33883358
caseT_JoinExpr:
33893359
retval=_equalJoinExpr(a,b);
33903360
break;
3391-
caseT_JsonFormat:
3392-
retval=_equalJsonFormat(a,b);
3393-
break;
3394-
caseT_JsonReturning:
3395-
retval=_equalJsonReturning(a,b);
3396-
break;
3397-
caseT_JsonValueExpr:
3398-
retval=_equalJsonValueExpr(a,b);
3399-
break;
34003361

34013362
/*
34023363
* RELATION NODES

‎src/backend/nodes/makefuncs.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
#include"catalog/pg_type.h"
2020
#include"nodes/makefuncs.h"
2121
#include"nodes/nodeFuncs.h"
22-
#include"utils/errcodes.h"
2322
#include"utils/lsyscache.h"
2423

2524

@@ -819,56 +818,3 @@ makeVacuumRelation(RangeVar *relation, Oid oid, List *va_cols)
819818
v->va_cols=va_cols;
820819
returnv;
821820
}
822-
823-
/*
824-
* makeJsonFormat -
825-
* creates a JsonFormat node
826-
*/
827-
JsonFormat*
828-
makeJsonFormat(JsonFormatTypetype,JsonEncodingencoding,intlocation)
829-
{
830-
JsonFormat*jf=makeNode(JsonFormat);
831-
832-
jf->format_type=type;
833-
jf->encoding=encoding;
834-
jf->location=location;
835-
836-
returnjf;
837-
}
838-
839-
/*
840-
* makeJsonValueExpr -
841-
* creates a JsonValueExpr node
842-
*/
843-
JsonValueExpr*
844-
makeJsonValueExpr(Expr*expr,JsonFormat*format)
845-
{
846-
JsonValueExpr*jve=makeNode(JsonValueExpr);
847-
848-
jve->raw_expr=expr;
849-
jve->formatted_expr=NULL;
850-
jve->format=format;
851-
852-
returnjve;
853-
}
854-
855-
/*
856-
* makeJsonEncoding -
857-
* converts JSON encoding name to enum JsonEncoding
858-
*/
859-
JsonEncoding
860-
makeJsonEncoding(char*name)
861-
{
862-
if (!pg_strcasecmp(name,"utf8"))
863-
returnJS_ENC_UTF8;
864-
if (!pg_strcasecmp(name,"utf16"))
865-
returnJS_ENC_UTF16;
866-
if (!pg_strcasecmp(name,"utf32"))
867-
returnJS_ENC_UTF32;
868-
869-
ereport(ERROR,
870-
(errcode(ERRCODE_INVALID_PARAMETER_VALUE),
871-
errmsg("unrecognized JSON encoding: %s",name)));
872-
873-
returnJS_ENC_DEFAULT;
874-
}

‎src/backend/nodes/nodeFuncs.c

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -250,13 +250,6 @@ exprType(const Node *expr)
250250
caseT_PlaceHolderVar:
251251
type=exprType((Node*) ((constPlaceHolderVar*)expr)->phexpr);
252252
break;
253-
caseT_JsonValueExpr:
254-
{
255-
constJsonValueExpr*jve= (constJsonValueExpr*)expr;
256-
257-
type=exprType((Node*) (jve->formatted_expr ?jve->formatted_expr :jve->raw_expr));
258-
}
259-
break;
260253
default:
261254
elog(ERROR,"unrecognized node type: %d", (int)nodeTag(expr));
262255
type=InvalidOid;/* keep compiler quiet */
@@ -489,8 +482,6 @@ exprTypmod(const Node *expr)
489482
return ((constSetToDefault*)expr)->typeMod;
490483
caseT_PlaceHolderVar:
491484
returnexprTypmod((Node*) ((constPlaceHolderVar*)expr)->phexpr);
492-
caseT_JsonValueExpr:
493-
returnexprTypmod((Node*) ((constJsonValueExpr*)expr)->formatted_expr);
494485
default:
495486
break;
496487
}
@@ -967,9 +958,6 @@ exprCollation(const Node *expr)
967958
caseT_PlaceHolderVar:
968959
coll=exprCollation((Node*) ((constPlaceHolderVar*)expr)->phexpr);
969960
break;
970-
caseT_JsonValueExpr:
971-
coll=exprCollation((Node*) ((constJsonValueExpr*)expr)->formatted_expr);
972-
break;
973961
default:
974962
elog(ERROR,"unrecognized node type: %d", (int)nodeTag(expr));
975963
coll=InvalidOid;/* keep compiler quiet */
@@ -1182,10 +1170,6 @@ exprSetCollation(Node *expr, Oid collation)
11821170
/* NextValueExpr's result is an integer type ... */
11831171
Assert(!OidIsValid(collation));/* ... so never set a collation */
11841172
break;
1185-
caseT_JsonValueExpr:
1186-
exprSetCollation((Node*) ((JsonValueExpr*)expr)->formatted_expr,
1187-
collation);
1188-
break;
11891173
default:
11901174
elog(ERROR,"unrecognized node type: %d", (int)nodeTag(expr));
11911175
break;
@@ -1632,9 +1616,6 @@ exprLocation(const Node *expr)
16321616
caseT_PartitionRangeDatum:
16331617
loc= ((constPartitionRangeDatum*)expr)->location;
16341618
break;
1635-
caseT_JsonValueExpr:
1636-
loc=exprLocation((Node*) ((constJsonValueExpr*)expr)->raw_expr);
1637-
break;
16381619
default:
16391620
/* for any other node type it's just unknown... */
16401621
loc=-1;
@@ -2369,16 +2350,6 @@ expression_tree_walker(Node *node,
23692350
return true;
23702351
}
23712352
break;
2372-
caseT_JsonValueExpr:
2373-
{
2374-
JsonValueExpr*jve= (JsonValueExpr*)node;
2375-
2376-
if (walker(jve->raw_expr,context))
2377-
return true;
2378-
if (walker(jve->formatted_expr,context))
2379-
return true;
2380-
}
2381-
break;
23822353
default:
23832354
elog(ERROR,"unrecognized node type: %d",
23842355
(int)nodeTag(node));
@@ -2709,7 +2680,6 @@ expression_tree_mutator(Node *node,
27092680
caseT_RangeTblRef:
27102681
caseT_SortGroupClause:
27112682
caseT_CTESearchClause:
2712-
caseT_JsonFormat:
27132683
return (Node*)copyObject(node);
27142684
caseT_WithCheckOption:
27152685
{
@@ -3341,28 +3311,6 @@ expression_tree_mutator(Node *node,
33413311
return (Node*)newnode;
33423312
}
33433313
break;
3344-
caseT_JsonReturning:
3345-
{
3346-
JsonReturning*jr= (JsonReturning*)node;
3347-
JsonReturning*newnode;
3348-
3349-
FLATCOPY(newnode,jr,JsonReturning);
3350-
MUTATE(newnode->format,jr->format,JsonFormat*);
3351-
3352-
return (Node*)newnode;
3353-
}
3354-
caseT_JsonValueExpr:
3355-
{
3356-
JsonValueExpr*jve= (JsonValueExpr*)node;
3357-
JsonValueExpr*newnode;
3358-
3359-
FLATCOPY(newnode,jve,JsonValueExpr);
3360-
MUTATE(newnode->raw_expr,jve->raw_expr,Expr*);
3361-
MUTATE(newnode->formatted_expr,jve->formatted_expr,Expr*);
3362-
MUTATE(newnode->format,jve->format,JsonFormat*);
3363-
3364-
return (Node*)newnode;
3365-
}
33663314
default:
33673315
elog(ERROR,"unrecognized node type: %d",
33683316
(int)nodeTag(node));
@@ -4071,20 +4019,6 @@ raw_expression_tree_walker(Node *node,
40714019
caseT_CommonTableExpr:
40724020
/* search_clause and cycle_clause are not interesting here */
40734021
returnwalker(((CommonTableExpr*)node)->ctequery,context);
4074-
caseT_JsonReturning:
4075-
returnwalker(((JsonReturning*)node)->format,context);
4076-
caseT_JsonValueExpr:
4077-
{
4078-
JsonValueExpr*jve= (JsonValueExpr*)node;
4079-
4080-
if (walker(jve->raw_expr,context))
4081-
return true;
4082-
if (walker(jve->formatted_expr,context))
4083-
return true;
4084-
if (walker(jve->format,context))
4085-
return true;
4086-
}
4087-
break;
40884022
default:
40894023
elog(ERROR,"unrecognized node type: %d",
40904024
(int)nodeTag(node));

‎src/backend/nodes/outfuncs.c

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1751,36 +1751,6 @@ _outOnConflictExpr(StringInfo str, const OnConflictExpr *node)
17511751
WRITE_NODE_FIELD(exclRelTlist);
17521752
}
17531753

1754-
staticvoid
1755-
_outJsonFormat(StringInfostr,constJsonFormat*node)
1756-
{
1757-
WRITE_NODE_TYPE("JSONFORMAT");
1758-
1759-
WRITE_ENUM_FIELD(format_type,JsonFormatType);
1760-
WRITE_ENUM_FIELD(encoding,JsonEncoding);
1761-
WRITE_LOCATION_FIELD(location);
1762-
}
1763-
1764-
staticvoid
1765-
_outJsonReturning(StringInfostr,constJsonReturning*node)
1766-
{
1767-
WRITE_NODE_TYPE("JSONRETURNING");
1768-
1769-
WRITE_NODE_FIELD(format);
1770-
WRITE_OID_FIELD(typid);
1771-
WRITE_INT_FIELD(typmod);
1772-
}
1773-
1774-
staticvoid
1775-
_outJsonValueExpr(StringInfostr,constJsonValueExpr*node)
1776-
{
1777-
WRITE_NODE_TYPE("JSONVALUEEXPR");
1778-
1779-
WRITE_NODE_FIELD(raw_expr);
1780-
WRITE_NODE_FIELD(formatted_expr);
1781-
WRITE_NODE_FIELD(format);
1782-
}
1783-
17841754
/*****************************************************************************
17851755
*
17861756
*Stuff from pathnodes.h.
@@ -4567,15 +4537,6 @@ outNode(StringInfo str, const void *obj)
45674537
caseT_PartitionRangeDatum:
45684538
_outPartitionRangeDatum(str,obj);
45694539
break;
4570-
caseT_JsonFormat:
4571-
_outJsonFormat(str,obj);
4572-
break;
4573-
caseT_JsonReturning:
4574-
_outJsonReturning(str,obj);
4575-
break;
4576-
caseT_JsonValueExpr:
4577-
_outJsonValueExpr(str,obj);
4578-
break;
45794540

45804541
default:
45814542

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp