mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:03:03 +01:00
Simplest fix for bug #8120 : Cast dies with numeric value is out of range error (5.0.1 snapshot)
This commit is contained in:
parent
9cb1165b8b
commit
44a69d866e
@ -2577,9 +2577,10 @@ static SSHORT cvt_get_short(const dsc* desc, SSHORT scale, DecimalStatus decSt,
|
||||
const char* p;
|
||||
USHORT length = CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), decSt, err);
|
||||
|
||||
{
|
||||
RetValue<SSHORTTraits> rv(&value);
|
||||
scale -= cvt_decompose(p, length, &rv, err);
|
||||
|
||||
}
|
||||
adjustForScale(value, scale, SHORT_LIMIT, err);
|
||||
}
|
||||
else {
|
||||
@ -4793,8 +4794,10 @@ SQUAD CVT_get_quad(const dsc* desc, SSHORT scale, DecimalStatus decSt, ErrorFunc
|
||||
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), decSt, err);
|
||||
|
||||
SINT64 i64;
|
||||
{
|
||||
RetValue<SINT64Traits> rv(&i64);
|
||||
scale -= cvt_decompose(p, length, &rv, err);
|
||||
}
|
||||
SINT64_to_SQUAD(i64, value);
|
||||
}
|
||||
break;
|
||||
|
Loading…
Reference in New Issue
Block a user