Skip to content

Commit 1c436e8

Browse files
committed
decouple Append & MergeAppend in plan_tree_walker()
1 parent 6c4f596 commit 1c436e8

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

src/planner_tree_modification.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ reset_query_id_generator(void)
132132

133133

134134
/*
135-
* Basic plan tree walker
135+
* Basic plan tree walker.
136136
*
137-
* 'visitor' is applied right before return
137+
* 'visitor' is applied right before return.
138138
*/
139139
void
140140
plan_tree_walker(Plan *plan,
@@ -165,15 +165,16 @@ plan_tree_walker(Plan *plan,
165165
plan_tree_walker((Plan *) lfirst(l), visitor, context);
166166
break;
167167

168-
/* Since they look alike */
169-
case T_MergeAppend:
170168
case T_Append:
171-
Assert(offsetof(Append, appendplans) ==
172-
offsetof(MergeAppend, mergeplans));
173169
foreach(l, ((Append *) plan)->appendplans)
174170
plan_tree_walker((Plan *) lfirst(l), visitor, context);
175171
break;
176172

173+
case T_MergeAppend:
174+
foreach(l, ((MergeAppend *) plan)->mergeplans)
175+
plan_tree_walker((Plan *) lfirst(l), visitor, context);
176+
break;
177+
177178
case T_BitmapAnd:
178179
foreach(l, ((BitmapAnd *) plan)->bitmapplans)
179180
plan_tree_walker((Plan *) lfirst(l), visitor, context);

0 commit comments

Comments
 (0)