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

MCOL-641 Followup on functions commit.

This commit is contained in:
Roman Nozdrin
2020-05-08 09:50:15 +00:00
parent cfe35b5c7f
commit 3d94ec1568
3 changed files with 20 additions and 3 deletions

View File

@ -820,7 +820,6 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, bool h
dataconvert::DataConvert::decimalToString(dec, dataconvert::DataConvert::decimalToString(dec,
(unsigned)colType.scale, buf, (unsigned)colType.scale, buf,
sizeof(buf), colType.colDataType); sizeof(buf), colType.colDataType);
std::cout << buf << std::endl;
Field_new_decimal* f2 = (Field_new_decimal*)*f; Field_new_decimal* f2 = (Field_new_decimal*)*f;
f2->store(buf, strlen(buf), f2->charset()); f2->store(buf, strlen(buf), f2->charset());

View File

@ -70,8 +70,8 @@ int64_t Func_ceil::getIntVal(Row& row,
} }
break; break;
// ceil(decimal(38,38)) leads to this path // ceil(decimal(X,Y)) leads to this path if X, Y allows to
// otherwise Func_ceil::getDecimalVal() is called // downcast to INT otherwise Func_ceil::getDecimalVal() is called
case execplan::CalpontSystemCatalog::DECIMAL: case execplan::CalpontSystemCatalog::DECIMAL:
case execplan::CalpontSystemCatalog::UDECIMAL: case execplan::CalpontSystemCatalog::UDECIMAL:
{ {

View File

@ -151,6 +151,24 @@ int64_t Func_floor::getIntVal(Row& row,
} }
break; break;
// floor(decimal(X,Y)) leads to this path if X, Y allows to
// downcast to INT otherwise Func_floor::getDecimalVal() is called
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL:
{
IDB_Decimal tmp = getDecimalVal(row, parm, isNull, op_ct);
if (op_ct.colWidth == datatypes::MAXDECIMALWIDTH)
{
ret = datatypes::Decimal::getInt64FromWideDecimal(tmp.s128Value);
}
else
{
ret = tmp.value;
}
break;
}
default: default:
{ {
std::ostringstream oss; std::ostringstream oss;