diff --git a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp index 2a8868ca06..bf267740b6 100644 --- a/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp +++ b/src/sql/resolver/expr/ob_raw_expr_deduce_type.cpp @@ -1368,7 +1368,7 @@ int ObRawExprDeduceType::visit(ObAggFunRawExpr &expr) result_type.set_calc_type(result_type.get_type()); expr.set_result_type(result_type); ObObjTypeClass from_tc = child_expr->get_type_class(); - need_add_cast = (ObUIntTC != from_tc); + need_add_cast = (ObUIntTC != from_tc && ObIntTC != from_tc); } break; }