You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-174 Replace custom helpers::power() with standard pow(). helpers::power() breaks with #dec > 9
This commit is contained in:
@ -156,9 +156,10 @@ string Func_char::getStrVal(Row& row,
|
||||
case execplan::CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
IDB_Decimal d = parm[0]->data()->getDecimalVal(row, isNull);
|
||||
double dscale = d.scale;
|
||||
// get decimal and round up
|
||||
int value = d.value / helpers::power(d.scale);
|
||||
int lefto = (d.value - value * helpers::power(d.scale)) / helpers::power(d.scale - 1);
|
||||
int value = d.value / pow(10.0, dscale);
|
||||
int lefto = (d.value - value * pow(10.0, dscale)) / pow(dscale - 1);
|
||||
|
||||
if ( lefto > 4 )
|
||||
value++;
|
||||
|
Reference in New Issue
Block a user