update src/gausskernel/optimizer/plan/createplan.cpp.

修改create_append_plan函数中对 path为subquery且bestpath->subpaths为空 的情况的处理
参考Gaussdb和Postgres中处理方式,将原有的断言修改为if判断。
当出现上述情况是判断subplan为dummy plan,是则继续执行make_subqueryscan;反之则执行make_result.
This commit is contained in:
徐鲲鹏
2020-10-17 10:25:47 +08:00
committed by Gitee
parent 7ba82481a4
commit 0d6450de27

View File

@ -1072,8 +1072,8 @@ static Plan* create_append_plan(PlannerInfo* root, AppendPath* best_path)
* subquery's rangetable so that the executor will apply permissions
* checks to those rels at runtime.)
*/
if (rel->rtekind == RTE_SUBQUERY) {
Assert(is_dummy_plan(rel->subplan));
if (rel->rtekind == RTE_SUBQUERY &&
(rel->subplan != NULL && is_dummy_plan(rel->subplan) == true)) {
return (Plan*)make_subqueryscan(tlist, NIL, rel->relid, rel->subplan);
} else {
/* Generate a Result plan with constant-FALSE gating qual */