From 864625fb4b55a2d9bad8061646b2ca4c8595ffd6 Mon Sep 17 00:00:00 2001 From: yinyj17 Date: Fri, 3 Nov 2023 02:39:40 +0000 Subject: [PATCH] fix rcte correctness bug when there is onetime expr --- src/sql/optimizer/ob_log_plan.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sql/optimizer/ob_log_plan.cpp b/src/sql/optimizer/ob_log_plan.cpp index 5b82365e1..cb32fc7fb 100644 --- a/src/sql/optimizer/ob_log_plan.cpp +++ b/src/sql/optimizer/ob_log_plan.cpp @@ -13674,13 +13674,14 @@ int ObLogPlan::allocate_material_for_recursive_cte_plan(ObIArrayget_type() && log_op_def::LOG_EXPR_VALUES != child_ops.at(i)->get_type()) { bool is_plan_root = child_ops.at(i)->is_plan_root(); + ObLogicalOperator *orig_op = child_ops.at(i); child_ops.at(i)->set_is_plan_root(false); if (OB_FAIL(log_plan->allocate_material_as_top(child_ops.at(i)))) { LOG_WARN("failed to allocate materialize as top", K(ret)); } else if (is_plan_root) { child_ops.at(i)->mark_is_plan_root(); child_ops.at(i)->get_plan()->set_plan_root(child_ops.at(i)); - if (OB_FAIL(child_ops.at(i)->set_plan_root_output_exprs())) { + if (OB_FAIL(child_ops.at(i)->get_output_exprs().assign(orig_op->get_output_exprs()))) { LOG_WARN("failed to set plan root output", K(ret)); } }