From f54c4341a1eb3077f0738fc302db89f76b26b549 Mon Sep 17 00:00:00 2001 From: hezuojiao Date: Mon, 28 Nov 2022 06:10:36 +0000 Subject: [PATCH] [CP] Fix logging core when casting obj in-place failed --- src/sql/engine/expr/ob_expr_operator.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/sql/engine/expr/ob_expr_operator.cpp b/src/sql/engine/expr/ob_expr_operator.cpp index de158c252..3c872c5d5 100644 --- a/src/sql/engine/expr/ob_expr_operator.cpp +++ b/src/sql/engine/expr/ob_expr_operator.cpp @@ -290,15 +290,16 @@ int OB_INLINE ObExprOperator::cast_operand_type(common::ObObj &res_obj, } else if (lib::is_mysql_mode() && ob_is_json(calc_type)) { cast_ctx.dest_collation_ = CS_TYPE_UTF8MB4_BIN; } - // FIXME: (xiaochu) 就地修改obj类型算法没问题吧? - ObObj res_obj_copy = res_obj; + ObObj tmp_obj; cast_ctx.expect_obj_collation_ = cast_ctx.dest_collation_; if (OB_FAIL(ObObjCaster::to_type(res_type.get_calc_type(), cast_ctx, - res_obj_copy, - res_obj))) { + res_obj, + tmp_obj))) { LOG_WARN("fail to convert type", K(ret), K(res_type.get_calc_type()), K(res_obj)); + } else { + res_obj = tmp_obj; } if (OB_SUCC(ret) && ob_is_string_or_lob_type(param_type)