From c5e1383f82d06acfb02067a25a9bbdb4371aedf8 Mon Sep 17 00:00:00 2001 From: obdev Date: Mon, 8 Aug 2022 16:10:41 +0800 Subject: [PATCH] [CP] Fix insert values op access enumset string_values core --- src/sql/code_generator/ob_static_engine_cg.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/sql/code_generator/ob_static_engine_cg.cpp b/src/sql/code_generator/ob_static_engine_cg.cpp index 212c024886..4a59a8a952 100644 --- a/src/sql/code_generator/ob_static_engine_cg.cpp +++ b/src/sql/code_generator/ob_static_engine_cg.cpp @@ -1296,8 +1296,17 @@ int ObStaticEngineCG::generate_spec(ObLogExprValues& op, ObExprValuesSpec& spec, ObRawExpr *output_raw_expr = op.get_output_exprs().at(i); const common::ObIArray &str_values = output_raw_expr->get_enum_set_values(); - if (OB_FAIL(spec.str_values_array_.at(i).assign(str_values))) { - LOG_WARN("fail to assign", K(ret), K(i), K(str_values)); + if (!str_values.empty()) { + if (OB_FAIL(spec.str_values_array_.at(i).prepare_allocate(str_values.count()))) { + LOG_WARN("init fixed array failed", K(ret)); + } else { + for (int64_t j = 0; OB_SUCC(ret) && j < str_values.count(); ++j) { + if (OB_FAIL(deep_copy_ob_string( + phy_plan_->get_allocator(), str_values.at(j), spec.str_values_array_.at(i).at(j)))) { + LOG_WARN("failed to deep copy string", K(ret), K(str_values)); + } + } + } } } LOG_DEBUG("finish assign str_values_array", K(ret), K(spec.str_values_array_));