fix cast string to number overflow bug
This commit is contained in:
parent
fd70eda21f
commit
7dc47e8efa
@ -3681,7 +3681,7 @@ static int string_number(
|
||||
ret = value.from_sci_opt(str.ptr(), str.length(), params, &res_precision, &res_scale);
|
||||
// select cast('1e500' as decimal); -> max_val
|
||||
// select cast('-1e500' as decimal); -> min_val
|
||||
if (CM_IS_SET_MIN_IF_OVERFLOW(cast_mode) && ret == OB_NUMERIC_OVERFLOW) {
|
||||
if (ret == OB_NUMERIC_OVERFLOW) {
|
||||
int64_t i = 0;
|
||||
while (i < str.length() && isspace(str[i])) {
|
||||
++i;
|
||||
|
@ -844,7 +844,7 @@ static OB_INLINE int common_string_number(
|
||||
ret = nmb.from_sci_opt(in_str.ptr(), in_str.length(), alloc, &res_precision, &res_scale);
|
||||
// select cast('1e500' as decimal); -> max_val
|
||||
// select cast('-1e500' as decimal); -> min_val
|
||||
if (OB_NUMERIC_OVERFLOW == ret && CM_IS_SET_MIN_IF_OVERFLOW(expr.extra_)) {
|
||||
if (OB_NUMERIC_OVERFLOW == ret) {
|
||||
int64_t i = 0;
|
||||
while (i < in_str.length() && isspace(in_str[i])) {
|
||||
++i;
|
||||
|
Loading…
x
Reference in New Issue
Block a user