8
0
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:
Vlad Khorsun 2024-05-24 16:23:40 +03:00 committed by GitHub
commit 67a5ca846f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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;