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
Reformat all code to coding standard
This commit is contained in:
@ -38,75 +38,90 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_second::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& resultType )
|
||||
{
|
||||
return resultType;
|
||||
return resultType;
|
||||
}
|
||||
|
||||
|
||||
int64_t Func_second::getIntVal(rowgroup::Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
int64_t val = 0;
|
||||
switch (parm[0]->data()->resultType().colDataType)
|
||||
{
|
||||
case execplan::CalpontSystemCatalog::BIGINT:
|
||||
case execplan::CalpontSystemCatalog::INT:
|
||||
case execplan::CalpontSystemCatalog::MEDINT:
|
||||
case execplan::CalpontSystemCatalog::TINYINT:
|
||||
case execplan::CalpontSystemCatalog::SMALLINT:
|
||||
{
|
||||
val = dataconvert::DataConvert::intToDatetime(parm[0]->data()->getIntVal(row, isNull));
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
break;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::DECIMAL:
|
||||
{
|
||||
if (parm[0]->data()->resultType().scale)
|
||||
{
|
||||
val = dataconvert::DataConvert::intToDatetime(parm[0]->data()->getIntVal(row, isNull));
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::DOUBLE:
|
||||
case execplan::CalpontSystemCatalog::FLOAT:
|
||||
{
|
||||
isNull = true;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull));
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
break;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::DATE:
|
||||
{
|
||||
val = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
case execplan::CalpontSystemCatalog::DATETIME:
|
||||
{
|
||||
val = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
isNull = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isNull)
|
||||
return -1;
|
||||
if ( val < 1000000000 )
|
||||
return 0;
|
||||
return (uint32_t)((val >> 20) & 0x3f);
|
||||
int64_t val = 0;
|
||||
|
||||
switch (parm[0]->data()->resultType().colDataType)
|
||||
{
|
||||
case execplan::CalpontSystemCatalog::BIGINT:
|
||||
case execplan::CalpontSystemCatalog::INT:
|
||||
case execplan::CalpontSystemCatalog::MEDINT:
|
||||
case execplan::CalpontSystemCatalog::TINYINT:
|
||||
case execplan::CalpontSystemCatalog::SMALLINT:
|
||||
{
|
||||
val = dataconvert::DataConvert::intToDatetime(parm[0]->data()->getIntVal(row, isNull));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::DECIMAL:
|
||||
{
|
||||
if (parm[0]->data()->resultType().scale)
|
||||
{
|
||||
val = dataconvert::DataConvert::intToDatetime(parm[0]->data()->getIntVal(row, isNull));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::DOUBLE:
|
||||
case execplan::CalpontSystemCatalog::FLOAT:
|
||||
{
|
||||
isNull = true;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::DATE:
|
||||
{
|
||||
val = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
|
||||
case execplan::CalpontSystemCatalog::DATETIME:
|
||||
{
|
||||
val = parm[0]->data()->getDatetimeIntVal(row, isNull);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
isNull = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isNull)
|
||||
return -1;
|
||||
|
||||
if ( val < 1000000000 )
|
||||
return 0;
|
||||
|
||||
return (uint32_t)((val >> 20) & 0x3f);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user