On Wed, Aug 9, 2017 at 6:51 PM, Haribabu Kommi <kommi.haribabu@gmail.com> wrote: > > > + if (IsA(plan, Gather)) > + ((Gather *) plan)->initParam = bms_intersect(plan->lefttree->extParam, > initSetParam); > + else if (IsA(plan, GatherMerge)) > + ((GatherMerge *) plan)->initParam = > bms_intersect(plan->lefttree->extParam, initSetParam); > + else > + elog(ERROR, "unrecognized node type: %d", nodeTag(plan)); > > The else case is not possible, because it is already validated for Gather or > GatherMerge. > Can we change it simple if and else? >
As we already have an assert in this function to protect from any other node type (nodes other than Gather and Gather Merge), it makes sense to change the code to just if...else, so changed accordingly.
Thanks for the updated patch. Patch looks fine. I just have some
minor comments.
+ * ExecEvalParamExecParams
+ *
+ * Execute the subplan stored in PARAM_EXEC initplans params, if not executed