You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-4409 Moved static Decimal conversion methods into VDecimal class
MCOL-4409 This patch combines VDecimal and Decimal and makes IDB_Decimal an alias for the result class MCOL-4409 More boilerplate reduction in Func_mod Removed couple TSInt128::toType() methods
This commit is contained in:
@ -77,22 +77,7 @@ string Func_elt::getStrVal(rowgroup::Row& row,
|
||||
|
||||
if (parm[0]->data()->resultType().colWidth == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
int128_t scaleDivisor, scaleDivisor2;
|
||||
|
||||
datatypes::getScaleDivisor(scaleDivisor, d.scale);
|
||||
|
||||
scaleDivisor2 = (scaleDivisor <= 10) ? 1 : (scaleDivisor / 10);
|
||||
|
||||
int128_t tmpval = d.s128Value / scaleDivisor;
|
||||
int128_t lefto = (d.s128Value - tmpval * scaleDivisor) / scaleDivisor2;
|
||||
|
||||
if (utils::is_nonnegative(tmpval) && lefto > 4)
|
||||
tmpval++;
|
||||
|
||||
if (utils::is_negative(tmpval) && lefto < -4)
|
||||
tmpval--;
|
||||
|
||||
number = datatypes::Decimal::getInt64FromWideDecimal(tmpval);
|
||||
number = static_cast<int64_t>(d.getPosNegRoundedIntegralPart(4));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user