From a6e0022fbe0faec12d29a4bc1308fc2643395d6a Mon Sep 17 00:00:00 2001 From: betelgeu <569268459@qq.com> Date: Fri, 15 Nov 2024 10:14:27 +0000 Subject: [PATCH] specify collation compatible with non-character types --- src/sql/engine/expr/ob_expr_collation.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sql/engine/expr/ob_expr_collation.cpp b/src/sql/engine/expr/ob_expr_collation.cpp index 0f4f62baa..ab7e0a500 100644 --- a/src/sql/engine/expr/ob_expr_collation.cpp +++ b/src/sql/engine/expr/ob_expr_collation.cpp @@ -286,6 +286,9 @@ int ObExprSetCollation::calc_result_type2(ObExprResType &type, } if (OB_SUCC(ret)) { type1.set_calc_type(ObVarcharType); + if (!type1.is_string_type()) { + type1.set_calc_collation_type(type2.get_collation_type()); + } type2.set_calc_type(ObIntType); } return ret;