mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 16:43: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;
|
const char* p;
|
||||||
USHORT length = CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), decSt, err);
|
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);
|
RetValue<SSHORTTraits> rv(&value);
|
||||||
|
scale -= cvt_decompose(p, length, &rv, err);
|
||||||
|
}
|
||||||
adjustForScale(value, scale, SHORT_LIMIT, err);
|
adjustForScale(value, scale, SHORT_LIMIT, err);
|
||||||
}
|
}
|
||||||
else {
|
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);
|
CVT_make_string(desc, ttype_ascii, &p, &buffer, sizeof(buffer), decSt, err);
|
||||||
|
|
||||||
SINT64 i64;
|
SINT64 i64;
|
||||||
RetValue<SINT64Traits> rv(&i64);
|
{
|
||||||
scale -= cvt_decompose(p, length, &rv, err);
|
RetValue<SINT64Traits> rv(&i64);
|
||||||
|
scale -= cvt_decompose(p, length, &rv, err);
|
||||||
|
}
|
||||||
SINT64_to_SQUAD(i64, value);
|
SINT64_to_SQUAD(i64, value);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Loading…
Reference in New Issue
Block a user