1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-3959 Separate processing for decimal

Preserves precision better than double
This commit is contained in:
David Hall
2020-04-23 16:56:17 -05:00
parent 9bec66c36f
commit 3f4b05c3ce

View File

@ -52,7 +52,6 @@ DateTime getDateTime(rowgroup::Row& row,
{
case execplan::CalpontSystemCatalog::FLOAT:
case execplan::CalpontSystemCatalog::DOUBLE:
case execplan::CalpontSystemCatalog::DECIMAL:
{
double value = parm[0]->data()->getDoubleVal(row, isNull);
double fracpart, intpart;
@ -61,6 +60,13 @@ DateTime getDateTime(rowgroup::Row& row,
msec = (uint32_t)(fracpart * IDB_pow[parm[0]->data()->resultType().scale]);
break;
}
case execplan::CalpontSystemCatalog::DECIMAL:
{
IDB_Decimal dec = parm[0]->data()->getDecimalVal(row, isNull);
val = dec.value / IDB_pow[dec.scale];
msec = dec.value % IDB_pow[dec.scale];
break;
}
default:
val = parm[0]->data()->getDatetimeIntVal(row, isNull);