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

MCOL-4387 Convert dataconvert::decimalToString() into VDecimal and TSInt128 methods

This commit is contained in:
Roman Nozdrin
2020-11-10 17:27:16 +00:00
parent 007b8a5082
commit 58495d0d2f
29 changed files with 793 additions and 878 deletions

View File

@ -1849,8 +1849,7 @@ string Func_format::getStrVal(Row& row,
{
IDB_Decimal decimal = parm[0]->data()->getDecimalVal(row, isNull);
char buf[80];
// This is an unacceptable way of doing rounding
//perform rouding if needed
if ( scale < 0 )
scale = 0;
@ -1912,9 +1911,7 @@ string Func_format::getStrVal(Row& row,
decimal.s128Value = x;
}
dataconvert::DataConvert::decimalToString(&decimal.s128Value,
decimal.scale, buf, 80, parm[0]->data()->resultType().colDataType);
value = decimal.toString(true);
}
else
{
@ -1973,12 +1970,8 @@ string Func_format::getStrVal(Row& row,
decimal.value = x;
}
dataconvert::DataConvert::decimalToString( decimal.value,
decimal.scale, buf, 80, parm[0]->data()->resultType().colDataType);
value = decimal.toString();
}
value = buf;
}
break;