mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 21:23:04 +01:00
Postfix for #7997: Unexpected results when comparing integer with string containing value out of range of that integer datatype; fixed regression in test core_1274
This commit is contained in:
parent
7029df2f99
commit
69d52d3246
@ -264,6 +264,8 @@ UCHAR CVT_get_numeric(const UCHAR* string, const USHORT length, SSHORT* scale, v
|
|||||||
sign = 1;
|
sign = 1;
|
||||||
else if (*p == 'e' || *p == 'E')
|
else if (*p == 'e' || *p == 'E')
|
||||||
break;
|
break;
|
||||||
|
else if (*p == '\0')
|
||||||
|
break;
|
||||||
else if (*p != ' ')
|
else if (*p != ' ')
|
||||||
CVT_conversion_error(&desc, ERR_post);
|
CVT_conversion_error(&desc, ERR_post);
|
||||||
}
|
}
|
||||||
@ -274,7 +276,7 @@ UCHAR CVT_get_numeric(const UCHAR* string, const USHORT length, SSHORT* scale, v
|
|||||||
if ((local_scale > MAX_SCHAR) || (local_scale < MIN_SCHAR))
|
if ((local_scale > MAX_SCHAR) || (local_scale < MIN_SCHAR))
|
||||||
over = true;
|
over = true;
|
||||||
|
|
||||||
if ((!over) && ((p < end) || // there is an exponent
|
if ((!over) && (((p < end) && *p) || // there is an exponent
|
||||||
((value < 0) && (sign != -1)))) // MAX_SINT64+1 wrapped around
|
((value < 0) && (sign != -1)))) // MAX_SINT64+1 wrapped around
|
||||||
{
|
{
|
||||||
// convert to double
|
// convert to double
|
||||||
|
Loading…
Reference in New Issue
Block a user