diff --git a/src/sql/engine/expr/ob_expr_operator.cpp b/src/sql/engine/expr/ob_expr_operator.cpp index de158c2522..3c872c5d5f 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)