From dfba79d833345e04469230011f7d5eefa3e89930 Mon Sep 17 00:00:00 2001 From: obdev Date: Tue, 15 Nov 2022 09:08:02 +0000 Subject: [PATCH] fix expr in sanity core cause of using hash calc when right params contain dynamic const --- src/sql/code_generator/ob_expr_generator_impl.cpp | 8 ++++---- src/sql/engine/expr/ob_expr_to_outfile_row.cpp | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/sql/code_generator/ob_expr_generator_impl.cpp b/src/sql/code_generator/ob_expr_generator_impl.cpp index 653edf54c0..f92c785190 100644 --- a/src/sql/code_generator/ob_expr_generator_impl.cpp +++ b/src/sql/code_generator/ob_expr_generator_impl.cpp @@ -790,7 +790,7 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr &expr, ObExprInOrNotIn bool param_all_same_cs_level = true; for (int64_t j = 0; OB_SUCC(ret) && j < in_op->get_row_dimension(); ++j) { param_all_const &= param1->get_param_expr(0)->get_param_expr(j) - ->is_const_expr(); + ->is_static_const_expr(); ObObjType first_obj_type = param1->get_param_expr(0)->get_param_expr(j) ->get_data_type(); ObObjType cur_obj_type = ObMaxType; @@ -811,7 +811,7 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr &expr, ObExprInOrNotIn } if (ObNullType != first_obj_type && ObNullType != cur_obj_type) { param_all_const &= param1->get_param_expr(i)->get_param_expr(j) - ->is_const_expr(); + ->is_static_const_expr(); param_all_same_type &= (first_obj_type == cur_obj_type); param_all_same_cs_type &= (first_obj_cs_type == cur_obj_cs_type); param_all_same_cs_level &= (first_obj_cs_level == cur_obj_cs_level); @@ -844,7 +844,7 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr &expr, ObExprInOrNotIn } } if (OB_SUCC(ret)) { - bool param_all_const = param1->get_param_expr(0)->is_const_expr(); + bool param_all_const = param1->get_param_expr(0)->is_static_const_expr(); bool param_all_same_type = true; bool param_all_same_cs_type = true; bool param_all_is_ext = true; @@ -865,7 +865,7 @@ inline int ObExprGeneratorImpl::visit_in_expr(ObOpRawExpr &expr, ObExprInOrNotIn first_obj_cs_type = cur_obj_cs_type; } if (ObNullType != first_obj_type && ObNullType != cur_obj_type) { - param_all_const &= param1->get_param_expr(i)->is_const_expr(); + param_all_const &= param1->get_param_expr(i)->is_static_const_expr(); param_all_same_type &= (first_obj_type == cur_obj_type); param_all_same_cs_type &= (first_obj_cs_type == cur_obj_cs_type); param_all_same_cs_level &= (first_obj_cs_level == cur_obj_cs_level); diff --git a/src/sql/engine/expr/ob_expr_to_outfile_row.cpp b/src/sql/engine/expr/ob_expr_to_outfile_row.cpp index 8307849f49..1a444ecf56 100644 --- a/src/sql/engine/expr/ob_expr_to_outfile_row.cpp +++ b/src/sql/engine/expr/ob_expr_to_outfile_row.cpp @@ -277,9 +277,9 @@ int ObExprToOutfileRow::print_field(char *buf, const int64_t buf_len, int64_t &p int ObExprToOutfileRow::print_wchar_to_buf(char *buf, const int64_t buf_len, int64_t &pos, int32_t wchar, ObCollationType coll_type) { - int ret = OB_SUCCESS; - int result_len = 0; - if (OB_FAIL(ObCharset::wc_mb(coll_type, wchar, buf + pos, buf_len - pos, result_len))) { + int ret = OB_SUCCESS; + int result_len = 0; + if (OB_FAIL(ObCharset::wc_mb(coll_type, wchar, buf + pos, buf_len - pos, result_len))) { LOG_WARN("failed to convert wc to mb"); } else { pos += result_len;