1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-4394 __float128 related code had been moved into a separate file

Trim to double and to long double conversions for Decimal
This commit is contained in:
Roman Nozdrin
2020-11-16 11:15:57 +00:00
parent 23af547fb8
commit 178be69bc4
12 changed files with 168 additions and 89 deletions

View File

@ -1881,9 +1881,11 @@ double Func_cast_decimal::getDoubleVal(Row& row,
isNull,
operationColType);
// WIP MCOL-641 This could deliver wrong result b/c wide DECIMAL might have
// p <= INT64MAXPRECISION
if (decimal.precision > datatypes::INT64MAXPRECISION)
{
return datatypes::Decimal::getDoubleFromWideDecimal(decimal.s128Value, decimal.scale);
return static_cast<double>(decimal);
}
return (double) decimal.value / helpers::powerOf10_c[decimal.scale];
@ -1994,7 +1996,7 @@ double Func_cast_double::getDoubleVal(Row& row,
if (parm[0]->data()->resultType().colWidth == datatypes::MAXDECIMALWIDTH)
{
dblval = datatypes::Decimal::getDoubleFromWideDecimal(decimal.s128Value, decimal.scale);
dblval = static_cast<double>(decimal);
}
else
{