Fix two errorcode related bugs: issue 46899782 and issue 45900041

This commit is contained in:
obdev
2023-07-20 01:42:10 +00:00
committed by ob-robot
parent b4eaec0f1c
commit fff9fe9da3
4 changed files with 12 additions and 4 deletions

View File

@ -967,8 +967,12 @@ int common_string_double(const ObExpr &expr,
}
} else if (OB_FAIL(check_convert_str_err(in_str.ptr(), endptr, in_str.length(), err, in_cs_type))) {
LOG_WARN("failed to check_convert_str_err", K(ret), K(in_str), K(out_val), K(err), K(in_cs_type));
ret = OB_ERR_DOUBLE_TRUNCATED;
// Compatible with oracle error massage, mapping `OB_ERR_DOUBLE_TRUNCATED` to invalid number error
if (lib::is_oracle_mode()) {
ret = OB_ERR_DOUBLE_TRUNCATED;
}
if (CM_IS_WARN_ON_FAIL(expr.extra_)) {
ret = OB_ERR_DOUBLE_TRUNCATED;
LOG_USER_WARN(OB_ERR_DOUBLE_TRUNCATED, in_str.length(), in_str.ptr());
}
}