mirror of
https://github.com/FirebirdSQL/firebird.git
synced 2025-01-22 20:43:02 +01:00
Merge pull request #8129 from FirebirdSQL/work/gh-8120
Simplest fix for bug #8120 : Cast dies with numeric value is out of range error (5.0.1 snapshot)
This commit is contained in:
commit
67a5ca846f
@ -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);
|
||||
|
||||
{
|
||||
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);
|
||||
{
|
||||
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