提交 f2f2aed9 编写于 作者: B br0 提交者: LINGuanRen

Fix cast mode bug when cast string to int explicitly

上级 4405ab1a
......@@ -505,6 +505,10 @@ int ObExprCast::calc_result2(ObObj& result, const ObObj& obj1, const ObObj& obj2
}
LOG_DEBUG("get accuracy from result_type", K(src_type), K(dest_type), K(accuracy), K(result_type_));
ObCastMode cast_mode = CM_EXPLICIT_CAST;
if (share::is_mysql_mode() && ob_is_string_type(src_type) &&
((ob_is_int_tc(dest_type)) || ob_is_uint_tc(dest_type))) {
cast_mode |= CM_STRING_INTEGER_TRUNC;
}
if (ObDateTimeTC == dest_tc || ObDateTC == dest_tc || ObTimeTC == dest_tc) {
cast_mode |= CM_NULL_ON_WARN;
} else if (ob_is_int_uint(src_tc, dest_tc)) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册