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
clang format apply
This commit is contained in:
@ -17,10 +17,10 @@
|
||||
MA 02110-1301, USA. */
|
||||
|
||||
/****************************************************************************
|
||||
* $Id: func_isnull.cpp 3648 2013-03-19 21:33:52Z dhall $
|
||||
*
|
||||
*
|
||||
****************************************************************************/
|
||||
* $Id: func_isnull.cpp 3648 2013-03-19 21:33:52Z dhall $
|
||||
*
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#include <cstdlib>
|
||||
#include <string>
|
||||
@ -37,13 +37,12 @@ using namespace rowgroup;
|
||||
|
||||
namespace funcexp
|
||||
{
|
||||
|
||||
CalpontSystemCatalog::ColType Func_isnull::operationType (FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
CalpontSystemCatalog::ColType Func_isnull::operationType(FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
{
|
||||
// operation type of idb_isnull should be the same as the argument type
|
||||
assert (fp.size() == 1);
|
||||
return fp[0]->data()->resultType();
|
||||
// operation type of idb_isnull should be the same as the argument type
|
||||
assert(fp.size() == 1);
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -51,44 +50,33 @@ CalpontSystemCatalog::ColType Func_isnull::operationType (FunctionParm& fp,
|
||||
*
|
||||
* This would be the most commonly called API for idb_isnull function
|
||||
*/
|
||||
bool Func_isnull::getBoolVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
bool Func_isnull::getBoolVal(Row& row, FunctionParm& parm, bool& isNull, CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
switch (op_ct.colDataType)
|
||||
{
|
||||
// For the purpose of this function, one does not need to get the value of
|
||||
// the argument. One only need to know if the argument is NULL. The passed
|
||||
// in parameter isNull will be set if the parameter is evaluated NULL.
|
||||
// Please note that before this function returns, isNull should be set to
|
||||
// false, otherwise the result of the function would be considered NULL,
|
||||
// which is not possible for idb_isnull().
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
parm[0]->data()->getDecimalVal(row, isNull);
|
||||
break;
|
||||
switch (op_ct.colDataType)
|
||||
{
|
||||
// For the purpose of this function, one does not need to get the value of
|
||||
// the argument. One only need to know if the argument is NULL. The passed
|
||||
// in parameter isNull will be set if the parameter is evaluated NULL.
|
||||
// Please note that before this function returns, isNull should be set to
|
||||
// false, otherwise the result of the function would be considered NULL,
|
||||
// which is not possible for idb_isnull().
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
case CalpontSystemCatalog::UDECIMAL: parm[0]->data()->getDecimalVal(row, isNull); break;
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
parm[0]->data()->getStrVal(row, isNull);
|
||||
break;
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::TEXT:
|
||||
case CalpontSystemCatalog::VARCHAR: parm[0]->data()->getStrVal(row, isNull); break;
|
||||
|
||||
case CalpontSystemCatalog::LONGDOUBLE:
|
||||
parm[0]->data()->getLongDoubleVal(row, isNull);
|
||||
break;
|
||||
case CalpontSystemCatalog::LONGDOUBLE: parm[0]->data()->getLongDoubleVal(row, isNull); break;
|
||||
|
||||
default:
|
||||
parm[0]->data()->getIntVal(row, isNull);
|
||||
}
|
||||
default: parm[0]->data()->getIntVal(row, isNull);
|
||||
}
|
||||
|
||||
bool ret = isNull;
|
||||
// It's important to reset isNull indicator.
|
||||
isNull = false;
|
||||
return (fIsNotNull ? !ret : ret);
|
||||
bool ret = isNull;
|
||||
// It's important to reset isNull indicator.
|
||||
isNull = false;
|
||||
return (fIsNotNull ? !ret : ret);
|
||||
}
|
||||
|
||||
|
||||
} // namespace funcexp
|
||||
} // namespace funcexp
|
||||
// vim:ts=4 sw=4:
|
||||
|
Reference in New Issue
Block a user