未验证 提交 379fceda 编写于 作者: P Paul Guo 提交者: GitHub

Fix FIXME in is_dummy_plan_walker() and also refactor the code a bit. (#6830)

For LockRows node, if its outer plan is dummy then there will be no
row for locking and thus it could be dummy.
Reviewed-by: NHeikki Linnakangas <hlinnakangas@pivotal.io>
上级 227046fc
......@@ -3309,22 +3309,6 @@ is_dummy_plan_walker(Node *node, bool *context)
switch (nodeTag(node))
{
case T_LockRows:
/*
* GPDB_94_MERGE_FIXME
* If the LockRow node is a dummy plan, then we should think of it
* as a dummy plan. Is this assumption correct?
*/
{
if (is_dummy_plan(outerPlan(node)))
{
*context = true;
return true;
}
}
return false;
case T_Result:
/*
......@@ -3352,23 +3336,6 @@ is_dummy_plan_walker(Node *node, bool *context)
}
return false;
case T_SubqueryScan:
/*
* A SubqueryScan is dummy, if its subplan is dummy.
*/
{
SubqueryScan *subqueryscan = (SubqueryScan *) node;
Plan *subplan = subqueryscan->subplan;
if (is_dummy_plan(subplan))
{
*context = true;
return true;
}
}
return false;
case T_NestLoop:
case T_MergeJoin:
case T_HashJoin:
......@@ -3415,10 +3382,12 @@ is_dummy_plan_walker(Node *node, bool *context)
case T_Material:
case T_Sort:
case T_Unique:
case T_LockRows:
case T_SubqueryScan:
/*
* Some node types are dummy, if their outer plan is dummy so we
* just recur.
* Some node types are dummy, if their outer plan or subplan is
* dummy so we just recur.
*
* We don't include "tricky" nodes like Motion that might affect
* plan topology, even though we know they will return no rows
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册