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:
@ -41,11 +41,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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@ -54,37 +54,38 @@ namespace funcexp
|
||||
|
||||
CalpontSystemCatalog::ColType Func_strcmp::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_strcmp::getIntVal(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);
|
||||
|
||||
const string& str1 = fp[1]->data()->getStrVal(row, isNull);
|
||||
int ret = utf8::idb_strcoll(str.c_str(), str1.c_str());
|
||||
// mysql's strcmp returns only -1, 0, and 1
|
||||
return (ret < 0 ? -1 : (ret > 0 ? 1 : 0));
|
||||
const string& str1 = fp[1]->data()->getStrVal(row, isNull);
|
||||
int ret = utf8::idb_strcoll(str.c_str(), str1.c_str());
|
||||
// mysql's strcmp returns only -1, 0, and 1
|
||||
return (ret < 0 ? -1 : (ret > 0 ? 1 : 0));
|
||||
}
|
||||
|
||||
|
||||
std::string Func_strcmp::getStrVal(rowgroup::Row& row,
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& fp,
|
||||
bool& isNull,
|
||||
execplan::CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
uint64_t val = getIntVal(row, fp, isNull, op_ct);
|
||||
if (val > 0)
|
||||
return string("1");
|
||||
else if (val < 0)
|
||||
return string("-1");
|
||||
else
|
||||
return string("0");
|
||||
uint64_t val = getIntVal(row, fp, isNull, op_ct);
|
||||
|
||||
if (val > 0)
|
||||
return string("1");
|
||||
else if (val < 0)
|
||||
return string("-1");
|
||||
else
|
||||
return string("0");
|
||||
}
|
||||
|
||||
} // namespace funcexp
|
||||
|
Reference in New Issue
Block a user