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-641 Add support for functions (Part 1).
This commit is contained in:
committed by
Roman Nozdrin
parent
554c6da8e8
commit
cfe35b5c7f
@ -154,21 +154,34 @@ execplan::IDB_Decimal Func_inet_aton::getDecimalVal(rowgroup::Row& row,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
// std::cout << "In Func_inet_aton::getDecimalVal" << std::endl;
|
||||
|
||||
execplan::IDB_Decimal dValue ( joblist::NULL_INT64, 0, 0 );
|
||||
execplan::CalpontSystemCatalog::ColType colType = fp[0]->data()->resultType();
|
||||
|
||||
const std::string& sValue = fp[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
if (!isNull)
|
||||
if (colType.precision <= datatypes::INT64MAXPRECISION)
|
||||
{
|
||||
int64_t iValue = convertAton( sValue, isNull );
|
||||
|
||||
if (!isNull)
|
||||
return execplan::IDB_Decimal( iValue, 0, 0 );
|
||||
}
|
||||
{
|
||||
int64_t iValue = convertAton( sValue, isNull );
|
||||
|
||||
return dValue;
|
||||
if (!isNull)
|
||||
return execplan::IDB_Decimal( iValue, colType.scale, colType.precision );
|
||||
}
|
||||
|
||||
return execplan::IDB_Decimal( joblist::NULL_INT64, colType.scale, colType.precision );
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!isNull)
|
||||
{
|
||||
int64_t iValue = convertAton( sValue, isNull );
|
||||
|
||||
if (!isNull)
|
||||
return execplan::IDB_Decimal( 0, colType.scale, colType.precision, (int128_t) iValue );
|
||||
}
|
||||
|
||||
return execplan::IDB_Decimal( 0, colType.scale, colType.precision, datatypes::Decimal128Null );
|
||||
}
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user