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

@ -42,11 +42,11 @@ using namespace funcexp;
class to_lower
{
public:
char operator() (char c) const // notice the return type
{
return tolower(c);
}
public:
char operator() (char c) const // notice the return type
{
return tolower(c);
}
};
@ -55,146 +55,155 @@ namespace funcexp
CalpontSystemCatalog::ColType Func_greatest::operationType(FunctionParm& fp, CalpontSystemCatalog::ColType& resultType)
{
// operation type is not used by this functor
//return fp[0]->data()->resultType();
return resultType;
// operation type is not used by this functor
//return fp[0]->data()->resultType();
return resultType;
}
int64_t Func_greatest::getIntVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
{
double str = fp[0]->data()->getDoubleVal(row, isNull);
double str = fp[0]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
if ( greatestStr < str1 )
greatestStr = str1;
}
if ( greatestStr < str1 )
greatestStr = str1;
}
uint64_t tmp = (uint64_t)greatestStr;
return (int64_t) tmp;
return (int64_t) tmp;
}
uint64_t Func_greatest::getUintVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
{
double str = fp[0]->data()->getDoubleVal(row, isNull);
double str = fp[0]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
if ( greatestStr < str1 )
greatestStr = str1;
}
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
return (uint64_t) greatestStr;
if ( greatestStr < str1 )
greatestStr = str1;
}
return (uint64_t) greatestStr;
}
double Func_greatest::getDoubleVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
{
double str = fp[0]->data()->getDoubleVal(row, isNull);
double str = fp[0]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
double greatestStr = str;
if ( greatestStr < str1 )
greatestStr = str1;
}
for (uint32_t i = 1; i < fp.size(); i++)
{
double str1 = fp[i]->data()->getDoubleVal(row, isNull);
return (double) greatestStr;
if ( greatestStr < str1 )
greatestStr = str1;
}
return (double) greatestStr;
}
std::string Func_greatest::getStrVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& op_ct)
{
const string& str = fp[0]->data()->getStrVal(row, isNull);
const string& str = fp[0]->data()->getStrVal(row, isNull);
string greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
const string& str1 = fp[i]->data()->getStrVal(row, isNull);
string greatestStr = str;
int tmp = utf8::idb_strcoll(greatestStr.c_str(), str1.c_str());
if ( tmp < 0 )
for (uint32_t i = 1; i < fp.size(); i++)
{
const string& str1 = fp[i]->data()->getStrVal(row, isNull);
int tmp = utf8::idb_strcoll(greatestStr.c_str(), str1.c_str());
if ( tmp < 0 )
// if ( greatestStr < str1 )
greatestStr = str1;
}
greatestStr = str1;
}
return greatestStr;
return greatestStr;
}
IDB_Decimal Func_greatest::getDecimalVal(Row& row,
FunctionParm& fp,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
FunctionParm& fp,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
// double str = fp[0]->data()->getDoubleVal(row, isNull);
IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull);
IDB_Decimal str = fp[0]->data()->getDecimalVal(row, isNull);
IDB_Decimal greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
IDB_Decimal str1 = fp[i]->data()->getDecimalVal(row, isNull);
IDB_Decimal greatestStr = str;
if ( greatestStr < str1 )
greatestStr = str1;
}
for (uint32_t i = 1; i < fp.size(); i++)
{
IDB_Decimal str1 = fp[i]->data()->getDecimalVal(row, isNull);
return greatestStr;
if ( greatestStr < str1 )
greatestStr = str1;
}
return greatestStr;
}
int32_t Func_greatest::getDateIntVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& ct)
{
int32_t str = fp[0]->data()->getDateIntVal(row, isNull);
int32_t str = fp[0]->data()->getDateIntVal(row, isNull);
int32_t greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
int32_t str1 = fp[i]->data()->getDateIntVal(row, isNull);
int32_t greatestStr = str;
if ( greatestStr < str1 )
greatestStr = str1;
}
for (uint32_t i = 1; i < fp.size(); i++)
{
int32_t str1 = fp[i]->data()->getDateIntVal(row, isNull);
return greatestStr;
if ( greatestStr < str1 )
greatestStr = str1;
}
return greatestStr;
}
int64_t Func_greatest::getDatetimeIntVal(rowgroup::Row& row,
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& ct)
FunctionParm& fp,
bool& isNull,
execplan::CalpontSystemCatalog::ColType& ct)
{
int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull);
int64_t str = fp[0]->data()->getDatetimeIntVal(row, isNull);
int64_t greatestStr = str;
for (uint32_t i = 1; i < fp.size(); i++)
{
int64_t str1 = fp[i]->data()->getDatetimeIntVal(row, isNull);
int64_t greatestStr = str;
if ( greatestStr < str1 )
greatestStr = str1;
}
for (uint32_t i = 1; i < fp.size(); i++)
{
int64_t str1 = fp[i]->data()->getDatetimeIntVal(row, isNull);
return greatestStr;
if ( greatestStr < str1 )
greatestStr = str1;
}
return greatestStr;
}
} // namespace funcexp