8
0
mirror of https://github.com/FirebirdSQL/firebird.git synced 2025-01-22 23:23:02 +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:
Vlad Khorsun 2024-05-24 15:27:41 +03:00
parent 29d2dbd47b
commit 9d652f1d17

View File

@ -1182,9 +1182,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 {
@ -3399,8 +3400,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;