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

Commit5d29d52

Browse files
committed
Rework format of comments in headers for nodes
This is similar to835d476, except that this one is to add nodeattributes related to query jumbling and avoid long lines in the headersand in the node structures changed by this commit.Reviewed-by: Peter EisentrautDiscussion:https://postgr.es/m/Y5BHOUhX3zTH/ig6@paquier.xyz
1 parent8eba3e3 commit5d29d52

File tree

2 files changed

+398
-202
lines changed

2 files changed

+398
-202
lines changed

‎src/include/nodes/parsenodes.h

Lines changed: 114 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -123,47 +123,67 @@ typedef struct Query
123123

124124
CmdTypecommandType;/* select|insert|update|delete|merge|utility */
125125

126-
QuerySourcequerySource;/* where did I come from? */
126+
/* where did I come from? */
127+
QuerySourcequerySource;
127128

128129
/*
129130
* query identifier (can be set by plugins); ignored for equal, as it
130131
* might not be set; also not stored
131132
*/
132133
uint64queryIdpg_node_attr(equal_ignore,read_write_ignore,read_as(0));
133134

134-
boolcanSetTag;/* do I set the command result tag? */
135+
/* do I set the command result tag? */
136+
boolcanSetTag;
135137

136138
Node*utilityStmt;/* non-null if commandType == CMD_UTILITY */
137139

138-
intresultRelation;/* rtable index of target relation for
139-
* INSERT/UPDATE/DELETE/MERGE; 0 for SELECT */
140-
141-
boolhasAggs;/* has aggregates in tlist or havingQual */
142-
boolhasWindowFuncs;/* has window functions in tlist */
143-
boolhasTargetSRFs;/* has set-returning functions in tlist */
144-
boolhasSubLinks;/* has subquery SubLink */
145-
boolhasDistinctOn;/* distinctClause is from DISTINCT ON */
146-
boolhasRecursive;/* WITH RECURSIVE was specified */
147-
boolhasModifyingCTE;/* has INSERT/UPDATE/DELETE in WITH */
148-
boolhasForUpdate;/* FOR [KEY] UPDATE/SHARE was specified */
149-
boolhasRowSecurity;/* rewriter has applied some RLS policy */
150-
151-
boolisReturn;/* is a RETURN statement */
140+
/*
141+
* rtable index of target relation for INSERT/UPDATE/DELETE/MERGE; 0 for
142+
* SELECT.
143+
*/
144+
intresultRelation;
145+
146+
/* has aggregates in tlist or havingQual */
147+
boolhasAggs;
148+
/* has window functions in tlist */
149+
boolhasWindowFuncs;
150+
/* has set-returning functions in tlist */
151+
boolhasTargetSRFs;
152+
/* has subquery SubLink */
153+
boolhasSubLinks;
154+
/* distinctClause is from DISTINCT ON */
155+
boolhasDistinctOn;
156+
/* WITH RECURSIVE was specified */
157+
boolhasRecursive;
158+
/* has INSERT/UPDATE/DELETE in WITH */
159+
boolhasModifyingCTE;
160+
/* FOR [KEY] UPDATE/SHARE was specified */
161+
boolhasForUpdate;
162+
/* rewriter has applied some RLS policy */
163+
boolhasRowSecurity;
164+
/* is a RETURN statement */
165+
boolisReturn;
152166

153167
List*cteList;/* WITH list (of CommonTableExpr's) */
154168

155169
List*rtable;/* list of range table entries */
156-
List*rteperminfos;/* list of RTEPermissionInfo nodes for the
157-
* rtable entries having perminfoindex > 0 */
170+
171+
/*
172+
* list of RTEPermissionInfo nodes for the rtable entries having
173+
* perminfoindex > 0
174+
*/
175+
List*rteperminfos;
158176
FromExpr*jointree;/* table join tree (FROM and WHERE clauses);
159177
* also USING clause for MERGE */
160178

161179
List*mergeActionList;/* list of actions for MERGE (only) */
162-
boolmergeUseOuterJoin;/* whether to use outer join */
180+
/* whether to use outer join */
181+
boolmergeUseOuterJoin;
163182

164183
List*targetList;/* target list (of TargetEntry) */
165184

166-
OverridingKindoverride;/* OVERRIDING clause */
185+
/* OVERRIDING clause */
186+
OverridingKindoverride;
167187

168188
OnConflictExpr*onConflict;/* ON CONFLICT DO [NOTHING | UPDATE] */
169189

@@ -191,20 +211,25 @@ typedef struct Query
191211
Node*setOperations;/* set-operation tree if this is top level of
192212
* a UNION/INTERSECT/EXCEPT query */
193213

194-
List*constraintDeps;/* a list of pg_constraint OIDs that the query
195-
* depends on to be semantically valid */
214+
/*
215+
* A list of pg_constraint OIDs that the query depends on to be
216+
* semantically valid
217+
*/
218+
List*constraintDeps;
196219

197-
List*withCheckOptions;/* a list of WithCheckOption's (added
198-
* during rewrite) */
220+
/* a list of WithCheckOption's (added during rewrite) */
221+
List*withCheckOptions;
199222

200223
/*
201224
* The following two fields identify the portion of the source text string
202225
* containing this query. They are typically only populated in top-level
203226
* Queries, not in sub-queries. When not set, they might both be zero, or
204227
* both be -1 meaning "unknown".
205228
*/
206-
intstmt_location;/* start location, or -1 if unknown */
207-
intstmt_len;/* length in bytes; 0 means "rest of string" */
229+
/* start location, or -1 if unknown */
230+
intstmt_location;
231+
/* length in bytes; 0 means "rest of string" */
232+
intstmt_len;
208233
}Query;
209234

210235

@@ -1231,14 +1256,21 @@ typedef struct RangeTblFunction
12311256
NodeTagtype;
12321257

12331258
Node*funcexpr;/* expression tree for func call */
1234-
intfunccolcount;/* number of columns it contributes to RTE */
1259+
/* number of columns it contributes to RTE */
1260+
intfunccolcount;
12351261
/* These fields record the contents of a column definition list, if any: */
1236-
List*funccolnames;/* column names (list of String) */
1237-
List*funccoltypes;/* OID list of column type OIDs */
1238-
List*funccoltypmods;/* integer list of column typmods */
1239-
List*funccolcollations;/* OID list of column collation OIDs */
1262+
/* column names (list of String) */
1263+
List*funccolnames;
1264+
/* OID list of column type OIDs */
1265+
List*funccoltypes;
1266+
/* integer list of column typmods */
1267+
List*funccoltypmods;
1268+
/* OID list of column collation OIDs */
1269+
List*funccolcollations;
1270+
12401271
/* This is set during planning for use by the executor: */
1241-
Bitmapset*funcparams;/* PARAM_EXEC Param IDs affecting this func */
1272+
/* PARAM_EXEC Param IDs affecting this func */
1273+
Bitmapset*funcparams;
12421274
}RangeTblFunction;
12431275

12441276
/*
@@ -1345,7 +1377,8 @@ typedef struct SortGroupClause
13451377
Oideqop;/* the equality operator ('=' op) */
13461378
Oidsortop;/* the ordering operator ('<' op), or 0 */
13471379
boolnulls_first;/* do NULLs come before normal values? */
1348-
boolhashable;/* can eqop be implemented by hashing? */
1380+
/* can eqop be implemented by hashing? */
1381+
boolhashable;
13491382
}SortGroupClause;
13501383

13511384
/*
@@ -1435,21 +1468,31 @@ typedef struct GroupingSet
14351468
typedefstructWindowClause
14361469
{
14371470
NodeTagtype;
1438-
char*name;/* window name (NULL in an OVER clause) */
1439-
char*refname;/* referenced window name, if any */
1471+
/* window name (NULL in an OVER clause) */
1472+
char*name;
1473+
/* referenced window name, if any */
1474+
char*refname;
14401475
List*partitionClause;/* PARTITION BY list */
1441-
List*orderClause;/* ORDER BY list */
1476+
/* ORDER BY list */
1477+
List*orderClause;
14421478
intframeOptions;/* frame_clause options, see WindowDef */
14431479
Node*startOffset;/* expression for starting bound, if any */
14441480
Node*endOffset;/* expression for ending bound, if any */
1445-
List*runCondition;/* qual to help short-circuit execution */
1446-
OidstartInRangeFunc;/* in_range function for startOffset */
1447-
OidendInRangeFunc;/* in_range function for endOffset */
1448-
OidinRangeColl;/* collation for in_range tests */
1449-
boolinRangeAsc;/* use ASC sort order for in_range tests? */
1450-
boolinRangeNullsFirst;/* nulls sort first for in_range tests? */
1481+
/* qual to help short-circuit execution */
1482+
List*runCondition;
1483+
/* in_range function for startOffset */
1484+
OidstartInRangeFunc;
1485+
/* in_range function for endOffset */
1486+
OidendInRangeFunc;
1487+
/* collation for in_range tests */
1488+
OidinRangeColl;
1489+
/* use ASC sort order for in_range tests? */
1490+
boolinRangeAsc;
1491+
/* nulls sort first for in_range tests? */
1492+
boolinRangeNullsFirst;
14511493
Indexwinref;/* ID referenced by window functions */
1452-
boolcopiedOrder;/* did we copy orderClause from refname? */
1494+
/* did we copy orderClause from refname? */
1495+
boolcopiedOrder;
14531496
}WindowClause;
14541497

14551498
/*
@@ -1568,13 +1611,22 @@ typedef struct CommonTableExpr
15681611
CTECycleClause*cycle_clause;
15691612
intlocation;/* token location, or -1 if unknown */
15701613
/* These fields are set during parse analysis: */
1571-
boolcterecursive;/* is this CTE actually recursive? */
1572-
intcterefcount;/* number of RTEs referencing this CTE
1573-
* (excluding internal self-references) */
1574-
List*ctecolnames;/* list of output column names */
1575-
List*ctecoltypes;/* OID list of output column type OIDs */
1576-
List*ctecoltypmods;/* integer list of output column typmods */
1577-
List*ctecolcollations;/* OID list of column collation OIDs */
1614+
/* is this CTE actually recursive? */
1615+
boolcterecursive;
1616+
1617+
/*
1618+
* Number of RTEs referencing this CTE (excluding internal
1619+
* self-references)
1620+
*/
1621+
intcterefcount;
1622+
/* list of output column names */
1623+
List*ctecolnames;
1624+
/* OID list of output column type OIDs */
1625+
List*ctecoltypes;
1626+
/* integer list of output column typmods */
1627+
List*ctecoltypmods;
1628+
/* OID list of column collation OIDs */
1629+
List*ctecolcollations;
15781630
}CommonTableExpr;
15791631

15801632
/* Convenience macro to get the output tlist of a CTE's query */
@@ -1611,10 +1663,12 @@ typedef struct MergeAction
16111663
NodeTagtype;
16121664
boolmatched;/* true=MATCHED, false=NOT MATCHED */
16131665
CmdTypecommandType;/* INSERT/UPDATE/DELETE/DO NOTHING */
1614-
OverridingKindoverride;/* OVERRIDING clause */
1666+
/* OVERRIDING clause */
1667+
OverridingKindoverride;
16151668
Node*qual;/* transformed WHEN conditions */
16161669
List*targetList;/* the target list (of TargetEntry) */
1617-
List*updateColnos;/* target attribute numbers of an UPDATE */
1670+
/* target attribute numbers of an UPDATE */
1671+
List*updateColnos;
16181672
}MergeAction;
16191673

16201674
/*
@@ -1824,10 +1878,14 @@ typedef struct SetOperationStmt
18241878
/* Eventually add fields for CORRESPONDING spec here */
18251879

18261880
/* Fields derived during parse analysis: */
1827-
List*colTypes;/* OID list of output column type OIDs */
1828-
List*colTypmods;/* integer list of output column typmods */
1829-
List*colCollations;/* OID list of output column collation OIDs */
1830-
List*groupClauses;/* a list of SortGroupClause's */
1881+
/* OID list of output column type OIDs */
1882+
List*colTypes;
1883+
/* integer list of output column typmods */
1884+
List*colTypmods;
1885+
/* OID list of output column collation OIDs */
1886+
List*colCollations;
1887+
/* a list of SortGroupClause's */
1888+
List*groupClauses;
18311889
/* groupClauses is NIL if UNION ALL, but must be set otherwise */
18321890
}SetOperationStmt;
18331891

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp