From efc750aa8b37e949abf78235778f62c8a86631e9 Mon Sep 17 00:00:00 2001 From: Zach41 Date: Thu, 19 Dec 2024 10:15:09 +0000 Subject: [PATCH] Adjust expansion eval info clearing routine --- src/sql/engine/expand/ob_expand_vec_op.cpp | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/src/sql/engine/expand/ob_expand_vec_op.cpp b/src/sql/engine/expand/ob_expand_vec_op.cpp index 6c9f4c9a9..c466ed73f 100644 --- a/src/sql/engine/expand/ob_expand_vec_op.cpp +++ b/src/sql/engine/expand/ob_expand_vec_op.cpp @@ -551,14 +551,19 @@ void ObExpandVecOp::clear_evaluated_flags() // we don't clear evaluated flags of expand exprs and duplicate exprs // expand exprs do not need re-calculation, just set null flags // duplicate exprs are copied once, and do not changed ever since - for (int i = 0; i < MY_SPEC.output_.count(); i++) { - ObExpr *expr = MY_SPEC.output_.at(i); - bool is_expand_expr = has_exist_in_array(MY_SPEC.expand_exprs_, expr); - bool is_dup_expr = false; - for (int j = 0; !is_dup_expr && j < MY_SPEC.dup_expr_pairs_.count(); j++) { - is_dup_expr = (expr == MY_SPEC.dup_expr_pairs_.at(j).dup_expr_); + for (int i = 0; i < eval_infos_.count(); i++) { + bool is_expand_eval_info = false; + bool is_dup_expr_eval_info = false; + for (int j = 0; !is_expand_eval_info && j < MY_SPEC.expand_exprs_.count(); j++) { + is_expand_eval_info = eval_infos_.at(i) == &(MY_SPEC.expand_exprs_.at(j)->get_eval_info(eval_ctx_)); + } + for (int j = 0; !is_dup_expr_eval_info && j < MY_SPEC.dup_expr_pairs_.count(); j++) { + is_dup_expr_eval_info = + (eval_infos_.at(i) == &(MY_SPEC.dup_expr_pairs_.at(j).dup_expr_->get_eval_info(eval_ctx_))); + } + if (!is_dup_expr_eval_info && !is_expand_eval_info) { + eval_infos_.at(i)->clear_evaluated_flag(); } - if (!is_expand_expr && !is_dup_expr) { expr->get_eval_info(eval_ctx_).clear_evaluated_flag(); } } } } // end sql