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

Commit80a7298

Browse files
committed
Remove manual breaks in NodeTag assignments to fix duplicate tag numbers.
Commitf0e4475 added new node tags at a place in the tag numberingwhere there was no daylight left before the next hard-coded number,resulting in some duplicate tag assignments. This doesn't seem to havecaused any big problem so far, but it's surely trouble waiting to happen.We could adjust the manually assigned breakpoints to make more room,but that just leaves the same hazard waiting to strike again in future.What seems like a better idea is to get rid of the manual assignmentsand leave NodeTags to be automatically assigned, consecutively from oneon up. This means that any change in the tag list forces a backend-widerecompile, but realistically that's usually needed anyway.Discussion:https://postgr.es/m/29670.1482942811@sss.pgh.pa.us
1 parentdb779d9 commit80a7298

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

‎src/include/nodes/nodes.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818
* The first field of every node is NodeTag. Each node created (with makeNode)
1919
* will have one of the following tags as the value of its first field.
2020
*
21-
* Note thatthe numbers of thenodetags are not contiguous. We left holes
22-
*here so that we can add more tags without changing the existing enum's.
23-
*(Since nodetagnumbers neverexist outside backend memory, there's no
24-
*real harm in renumbering, it just costs a full rebuild ...)
21+
* Note thatinserting or deletingnodetypes changes the numbers of other
22+
*node types later in the list. This is no problem during development, since
23+
*the node numbersareneverstored on disk. But don't do it in a released
24+
*branch, because that would represent an ABI break for extensions.
2525
*/
2626
typedefenumNodeTag
2727
{
@@ -30,7 +30,7 @@ typedef enum NodeTag
3030
/*
3131
* TAGS FOR EXECUTOR NODES (execnodes.h)
3232
*/
33-
T_IndexInfo=10,
33+
T_IndexInfo,
3434
T_ExprContext,
3535
T_ProjectionInfo,
3636
T_JunkFilter,
@@ -41,7 +41,7 @@ typedef enum NodeTag
4141
/*
4242
* TAGS FOR PLAN NODES (plannodes.h)
4343
*/
44-
T_Plan=100,
44+
T_Plan,
4545
T_Result,
4646
T_ModifyTable,
4747
T_Append,
@@ -89,7 +89,7 @@ typedef enum NodeTag
8989
*
9090
* These should correspond one-to-one with Plan node types.
9191
*/
92-
T_PlanState=200,
92+
T_PlanState,
9393
T_ResultState,
9494
T_ModifyTableState,
9595
T_AppendState,
@@ -131,7 +131,7 @@ typedef enum NodeTag
131131
/*
132132
* TAGS FOR PRIMITIVE NODES (primnodes.h)
133133
*/
134-
T_Alias=300,
134+
T_Alias,
135135
T_RangeVar,
136136
T_Expr,
137137
T_Var,
@@ -188,7 +188,7 @@ typedef enum NodeTag
188188
* These correspond (not always one-for-one) to primitive nodes derived
189189
* from Expr.
190190
*/
191-
T_ExprState=400,
191+
T_ExprState,
192192
T_GenericExprState,
193193
T_WholeRowVarExprState,
194194
T_AggrefExprState,
@@ -220,7 +220,7 @@ typedef enum NodeTag
220220
/*
221221
* TAGS FOR PLANNER NODES (relation.h)
222222
*/
223-
T_PlannerInfo=500,
223+
T_PlannerInfo,
224224
T_PlannerGlobal,
225225
T_RelOptInfo,
226226
T_IndexOptInfo,
@@ -273,13 +273,13 @@ typedef enum NodeTag
273273
/*
274274
* TAGS FOR MEMORY NODES (memnodes.h)
275275
*/
276-
T_MemoryContext=600,
276+
T_MemoryContext,
277277
T_AllocSetContext,
278278

279279
/*
280280
* TAGS FOR VALUE NODES (value.h)
281281
*/
282-
T_Value=650,
282+
T_Value,
283283
T_Integer,
284284
T_Float,
285285
T_String,
@@ -301,7 +301,7 @@ typedef enum NodeTag
301301
/*
302302
* TAGS FOR STATEMENT NODES (mostly in parsenodes.h)
303303
*/
304-
T_Query=700,
304+
T_Query,
305305
T_PlannedStmt,
306306
T_InsertStmt,
307307
T_DeleteStmt,
@@ -411,7 +411,7 @@ typedef enum NodeTag
411411
/*
412412
* TAGS FOR PARSE TREE NODES (parsenodes.h)
413413
*/
414-
T_A_Expr=900,
414+
T_A_Expr,
415415
T_ColumnRef,
416416
T_ParamRef,
417417
T_A_Const,
@@ -478,7 +478,7 @@ typedef enum NodeTag
478478
* purposes (usually because they are involved in APIs where we want to
479479
* pass multiple object types through the same pointer).
480480
*/
481-
T_TriggerData=950,/* in commands/trigger.h */
481+
T_TriggerData,/* in commands/trigger.h */
482482
T_EventTriggerData,/* in commands/event_trigger.h */
483483
T_ReturnSetInfo,/* in nodes/execnodes.h */
484484
T_WindowObjectData,/* private in nodeWindowAgg.c */

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp