1
0
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:
Andrew Hutchings
2017-10-26 17:18:17 +01:00
parent 4985f3456e
commit 01446d1e22
1296 changed files with 403852 additions and 353747 deletions

View File

@ -45,130 +45,136 @@ namespace funcexp
CalpontSystemCatalog::ColType Func_ifnull::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType)
{
// operation type is not used by this functor
return fp[0]->data()->resultType();
// operation type is not used by this functor
return fp[0]->data()->resultType();
}
int64_t Func_ifnull::getIntVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return 0;
if (isNull)
return 0;
int64_t r = parm[0]->data()->getIntVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getIntVal(row, isNull);
}
int64_t r = parm[0]->data()->getIntVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getIntVal(row, isNull);
}
return r;
}
string Func_ifnull::getStrVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return string();
if (isNull)
return string();
const string& r = parm[0]->data()->getStrVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getStrVal(row, isNull);
}
const string& r = parm[0]->data()->getStrVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getStrVal(row, isNull);
}
return r;
}
IDB_Decimal Func_ifnull::getDecimalVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return IDB_Decimal();
if (isNull)
return IDB_Decimal();
IDB_Decimal r = parm[0]->data()->getDecimalVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getDecimalVal(row, isNull);
}
IDB_Decimal r = parm[0]->data()->getDecimalVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getDecimalVal(row, isNull);
}
return r;
}
double Func_ifnull::getDoubleVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return 0.0;
if (isNull)
return 0.0;
double r = parm[0]->data()->getDoubleVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getDoubleVal(row, isNull);
}
double r = parm[0]->data()->getDoubleVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getDoubleVal(row, isNull);
}
return r;
}
int32_t Func_ifnull::getDateIntVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return 0;
if (isNull)
return 0;
int64_t r = parm[0]->data()->getDateIntVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getDateIntVal(row, isNull);
}
int64_t r = parm[0]->data()->getDateIntVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getDateIntVal(row, isNull);
}
return r;
}
int64_t Func_ifnull::getDatetimeIntVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType&)
{
if (isNull)
return 0;
if (isNull)
return 0;
int64_t r = parm[0]->data()->getDatetimeIntVal(row, isNull);
if (isNull)
{
isNull = false;
return parm[1]->data()->getDatetimeIntVal(row, isNull);
}
int64_t r = parm[0]->data()->getDatetimeIntVal(row, isNull);
return r;
if (isNull)
{
isNull = false;
return parm[1]->data()->getDatetimeIntVal(row, isNull);
}
return r;
}
bool Func_ifnull::getBoolVal(Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
int64_t ret = getIntVal(row, parm, isNull, ct);
return (ret == 0 ? false : true);
int64_t ret = getIntVal(row, parm, isNull, ct);
return (ret == 0 ? false : true);
}
} // namespace funcexp