1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

clang format apply

This commit is contained in:
Leonid Fedorov
2022-01-21 16:43:49 +00:00
parent 6b6411229f
commit 04752ec546
1376 changed files with 393460 additions and 412662 deletions

View File

@ -16,10 +16,10 @@
MA 02110-1301, USA. */
/****************************************************************************
* $Id: func_from_days.cpp 3921 2013-06-19 18:59:56Z bwilkinson $
*
*
****************************************************************************/
* $Id: func_from_days.cpp 3921 2013-06-19 18:59:56Z bwilkinson $
*
*
****************************************************************************/
#include <cstdlib>
#include <string>
@ -37,56 +37,47 @@ using namespace dataconvert;
namespace funcexp
{
CalpontSystemCatalog::ColType Func_from_days::operationType( FunctionParm& fp, CalpontSystemCatalog::ColType& resultType )
CalpontSystemCatalog::ColType Func_from_days::operationType(FunctionParm& fp,
CalpontSystemCatalog::ColType& resultType)
{
return resultType;
return resultType;
}
int64_t Func_from_days::getIntVal(rowgroup::Row& row,
FunctionParm& parm,
bool& isNull,
int64_t Func_from_days::getIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType& op_ct)
{
return getDatetimeIntVal(row, parm, isNull, op_ct);
return getDatetimeIntVal(row, parm, isNull, op_ct);
}
string Func_from_days::getStrVal(rowgroup::Row& row,
FunctionParm& parm,
bool& isNull,
string Func_from_days::getStrVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
return intToString(getIntVal(row, parm, isNull, ct));
return intToString(getIntVal(row, parm, isNull, ct));
}
int32_t Func_from_days::getDateIntVal(rowgroup::Row& row,
FunctionParm& parm,
bool& isNull,
int32_t Func_from_days::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
return (((getDatetimeIntVal(row, parm, isNull, ct) >> 32) & 0xFFFFFFC0) | 0x3E);
return (((getDatetimeIntVal(row, parm, isNull, ct) >> 32) & 0xFFFFFFC0) | 0x3E);
}
int64_t Func_from_days::getDatetimeIntVal(rowgroup::Row& row,
FunctionParm& parm,
bool& isNull,
CalpontSystemCatalog::ColType& ct)
int64_t Func_from_days::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm, bool& isNull,
CalpontSystemCatalog::ColType& ct)
{
double val1 = parm[0]->data()->getDoubleVal(row, isNull);
int64_t daynr = (int64_t)(val1 > 0 ? val1 + 0.5 : val1 - 0.5);
double val1 = parm[0]->data()->getDoubleVal(row, isNull);
int64_t daynr = (int64_t)(val1 > 0 ? val1 + 0.5 : val1 - 0.5);
DateTime aDaytime;
helpers::get_date_from_mysql_daynr( daynr, aDaytime );
DateTime aDaytime;
helpers::get_date_from_mysql_daynr(daynr, aDaytime);
// to be safe
aDaytime.hour = 0;
aDaytime.minute = 0;
aDaytime.second = 0;
aDaytime.msecond = 0;
// to be safe
aDaytime.hour = 0;
aDaytime.minute = 0;
aDaytime.second = 0;
aDaytime.msecond = 0;
return (*(reinterpret_cast<uint64_t*> (&aDaytime)));
return (*(reinterpret_cast<uint64_t*>(&aDaytime)));
}
} // namespace funcexp
} // namespace funcexp
// vim:ts=4 sw=4: