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:
@ -53,70 +53,71 @@ UDFSDK::~UDFSDK()
|
||||
|
||||
/**
|
||||
* All UDF functions should be registered in the function map. They will be
|
||||
* picked up by the MariaDB ColumnStore F&E framework when the servers are started.
|
||||
* picked up by the MariaDB ColumnStore F&E framework when the servers are started.
|
||||
* That will make sure the UDF functions runs distributedly in ColumnStore
|
||||
* engines just like the internal ColumnStore functions.
|
||||
*/
|
||||
FuncMap UDFSDK::UDFMap() const
|
||||
{
|
||||
FuncMap fm;
|
||||
|
||||
// first: function name
|
||||
// second: Function pointer
|
||||
// please use lower case for the function name. Because the names might be
|
||||
// case-insensitive in MariaDB depending on the setting. In such case,
|
||||
// the function names passed to the interface is always in lower case.
|
||||
fm["mcs_add"] = new MCS_add();
|
||||
fm["mcs_isnull"] = new MCS_isnull();
|
||||
|
||||
return fm;
|
||||
FuncMap fm;
|
||||
|
||||
// first: function name
|
||||
// second: Function pointer
|
||||
// please use lower case for the function name. Because the names might be
|
||||
// case-insensitive in MariaDB depending on the setting. In such case,
|
||||
// the function names passed to the interface is always in lower case.
|
||||
fm["mcs_add"] = new MCS_add();
|
||||
fm["mcs_isnull"] = new MCS_isnull();
|
||||
|
||||
return fm;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* MCS_ADD implementation
|
||||
* MCS_ADD implementation
|
||||
*
|
||||
* OperationType() definition
|
||||
*/
|
||||
CalpontSystemCatalog::ColType MCS_add::operationType (FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
CalpontSystemCatalog::ColType MCS_add::operationType (FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
{
|
||||
// operation type of MCS_add is determined by the argument types
|
||||
assert (fp.size() == 2);
|
||||
CalpontSystemCatalog::ColType rt;
|
||||
if (fp[0]->data()->resultType() == fp[1]->data()->resultType())
|
||||
{
|
||||
rt = fp[0]->data()->resultType();
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::CHAR ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::CHAR ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::VARCHAR ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::VARCHAR ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DOUBLE ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DOUBLE)
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::DOUBLE;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DATE ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DATE ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DATETIME ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DATETIME)
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::BIGINT;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DECIMAL ||
|
||||
// operation type of MCS_add is determined by the argument types
|
||||
assert (fp.size() == 2);
|
||||
CalpontSystemCatalog::ColType rt;
|
||||
|
||||
if (fp[0]->data()->resultType() == fp[1]->data()->resultType())
|
||||
{
|
||||
rt = fp[0]->data()->resultType();
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::CHAR ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::CHAR ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::VARCHAR ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::VARCHAR ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DOUBLE ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DOUBLE)
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::DOUBLE;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DATE ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DATE ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DATETIME ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DATETIME)
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::BIGINT;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else if (fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::DECIMAL ||
|
||||
fp[0]->data()->resultType().colDataType == CalpontSystemCatalog::UDECIMAL ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::DECIMAL ||
|
||||
fp[1]->data()->resultType().colDataType == CalpontSystemCatalog::UDECIMAL)
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::DECIMAL;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (isUnsigned(fp[0]->data()->resultType().colDataType) ||
|
||||
isUnsigned(fp[1]->data()->resultType().colDataType))
|
||||
isUnsigned(fp[1]->data()->resultType().colDataType))
|
||||
{
|
||||
rt.colDataType = CalpontSystemCatalog::UBIGINT;
|
||||
rt.colWidth = 8;
|
||||
@ -126,8 +127,9 @@ CalpontSystemCatalog::ColType MCS_add::operationType (FunctionParm& fp,
|
||||
rt.colDataType = CalpontSystemCatalog::BIGINT;
|
||||
rt.colWidth = 8;
|
||||
}
|
||||
}
|
||||
return rt;
|
||||
}
|
||||
|
||||
return rt;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -136,66 +138,73 @@ CalpontSystemCatalog::ColType MCS_add::operationType (FunctionParm& fp,
|
||||
* This API is called when an double value is needed to return from the UDF function
|
||||
*/
|
||||
double MCS_add::getDoubleVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
switch (op_ct.colDataType)
|
||||
{
|
||||
// The APIs for the evaluation of the function parameters are the same getXXXval()
|
||||
// functions. However, only two arguments are passed in, the current
|
||||
// row reference and the NULL indicator isNull.
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
case CalpontSystemCatalog::MEDINT:
|
||||
case CalpontSystemCatalog::SMALLINT:
|
||||
case CalpontSystemCatalog::TINYINT:
|
||||
return ( parm[0]->data()->getIntVal(row, isNull) +
|
||||
parm[1]->data()->getIntVal(row, isNull));
|
||||
switch (op_ct.colDataType)
|
||||
{
|
||||
// The APIs for the evaluation of the function parameters are the same getXXXval()
|
||||
// functions. However, only two arguments are passed in, the current
|
||||
// row reference and the NULL indicator isNull.
|
||||
case CalpontSystemCatalog::BIGINT:
|
||||
case CalpontSystemCatalog::MEDINT:
|
||||
case CalpontSystemCatalog::SMALLINT:
|
||||
case CalpontSystemCatalog::TINYINT:
|
||||
return ( parm[0]->data()->getIntVal(row, isNull) +
|
||||
parm[1]->data()->getIntVal(row, isNull));
|
||||
|
||||
case CalpontSystemCatalog::UBIGINT:
|
||||
case CalpontSystemCatalog::UMEDINT:
|
||||
case CalpontSystemCatalog::USMALLINT:
|
||||
case CalpontSystemCatalog::UTINYINT:
|
||||
return ( parm[0]->data()->getUintVal(row, isNull) +
|
||||
parm[1]->data()->getUintVal(row, isNull));
|
||||
case CalpontSystemCatalog::DOUBLE:
|
||||
return ( parm[0]->data()->getDoubleVal(row, isNull) +
|
||||
parm[1]->data()->getDoubleVal(row, isNull));
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
|
||||
case CalpontSystemCatalog::DOUBLE:
|
||||
return ( parm[0]->data()->getDoubleVal(row, isNull) +
|
||||
parm[1]->data()->getDoubleVal(row, isNull));
|
||||
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
IDB_Decimal dec;
|
||||
IDB_Decimal op1 = parm[0]->data()->getDecimalVal(row, isNull);
|
||||
IDB_Decimal op2 = parm[1]->data()->getDecimalVal(row, isNull);
|
||||
if (op1.scale == op2.scale)
|
||||
{
|
||||
dec.scale = op1.scale;
|
||||
}
|
||||
else if (op1.scale >= op2.scale)
|
||||
{
|
||||
dec.scale = op2.scale;
|
||||
op1.value *= (int64_t)pow((double)10, op1.scale-op2.scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
dec.scale = op1.scale;
|
||||
op2.value *= (int64_t)pow((double)10, op2.scale-op1.scale);
|
||||
}
|
||||
dec.value = op1.value + op2.value;
|
||||
return (double)(dec.value / pow((double)10, dec.scale));
|
||||
}
|
||||
default:
|
||||
return ( parm[0]->data()->getDoubleVal(row, isNull) +
|
||||
parm[1]->data()->getDoubleVal(row, isNull));
|
||||
}
|
||||
return 0;
|
||||
{
|
||||
IDB_Decimal dec;
|
||||
IDB_Decimal op1 = parm[0]->data()->getDecimalVal(row, isNull);
|
||||
IDB_Decimal op2 = parm[1]->data()->getDecimalVal(row, isNull);
|
||||
|
||||
if (op1.scale == op2.scale)
|
||||
{
|
||||
dec.scale = op1.scale;
|
||||
}
|
||||
else if (op1.scale >= op2.scale)
|
||||
{
|
||||
dec.scale = op2.scale;
|
||||
op1.value *= (int64_t)pow((double)10, op1.scale - op2.scale);
|
||||
}
|
||||
else
|
||||
{
|
||||
dec.scale = op1.scale;
|
||||
op2.value *= (int64_t)pow((double)10, op2.scale - op1.scale);
|
||||
}
|
||||
|
||||
dec.value = op1.value + op2.value;
|
||||
return (double)(dec.value / pow((double)10, dec.scale));
|
||||
}
|
||||
|
||||
default:
|
||||
return ( parm[0]->data()->getDoubleVal(row, isNull) +
|
||||
parm[1]->data()->getDoubleVal(row, isNull));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
float MCS_add::getFloatVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (float)getDoubleVal(row, parm, isNull, op_ct);
|
||||
return (float)getDoubleVal(row, parm, isNull, op_ct);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -203,39 +212,39 @@ float MCS_add::getFloatVal(Row& row,
|
||||
*
|
||||
* This API is called when an integer value is needed to return from the UDF function
|
||||
*
|
||||
* Because the result type MCS_add is double(real), all the other API can simply call
|
||||
* Because the result type MCS_add is double(real), all the other API can simply call
|
||||
* getDoubleVal and apply the conversion. This method may not fit for all the UDF
|
||||
* implementation.
|
||||
*/
|
||||
int64_t MCS_add::getIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (int64_t)getDoubleVal(row, parm, isNull, op_ct);
|
||||
return (int64_t)getDoubleVal(row, parm, isNull, op_ct);
|
||||
}
|
||||
|
||||
string MCS_add::getStrVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
// One will need a more efficient implementation if this API is frequently
|
||||
// called for this UDF function. This code is for demonstration purpose.
|
||||
ostringstream oss;
|
||||
oss << getDoubleVal(row, parm, isNull, op_ct);
|
||||
return oss.str();
|
||||
// One will need a more efficient implementation if this API is frequently
|
||||
// called for this UDF function. This code is for demonstration purpose.
|
||||
ostringstream oss;
|
||||
oss << getDoubleVal(row, parm, isNull, op_ct);
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
IDB_Decimal MCS_add::getDecimalVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
IDB_Decimal dec;
|
||||
dec.value = getIntVal(row, parm, isNull, op_ct);
|
||||
dec.scale = 0;
|
||||
return dec;
|
||||
IDB_Decimal dec;
|
||||
dec.value = getIntVal(row, parm, isNull, op_ct);
|
||||
dec.scale = 0;
|
||||
return dec;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -245,11 +254,11 @@ IDB_Decimal MCS_add::getDecimalVal(Row& row,
|
||||
* or throw a customized exception here.
|
||||
*/
|
||||
int32_t MCS_add::getDateIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
throw logic_error("Invalid API called for MCS_ADD");
|
||||
throw logic_error("Invalid API called for MCS_ADD");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -259,32 +268,32 @@ int32_t MCS_add::getDateIntVal(Row& row,
|
||||
* or throw a customized exception here.
|
||||
*/
|
||||
int64_t MCS_add::getDatetimeIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (int64_t)getDoubleVal(row, parm, isNull, op_ct);
|
||||
return (int64_t)getDoubleVal(row, parm, isNull, op_ct);
|
||||
}
|
||||
|
||||
bool MCS_add::getBoolVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
/***************************************************************************
|
||||
* MCS_ISNULL implementation
|
||||
* MCS_ISNULL implementation
|
||||
*
|
||||
* OperationType() definition
|
||||
*/
|
||||
CalpontSystemCatalog::ColType MCS_isnull::operationType (FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
CalpontSystemCatalog::ColType MCS_isnull::operationType (FunctionParm& fp,
|
||||
CalpontSystemCatalog::ColType& resultType)
|
||||
{
|
||||
// operation type of MCS_isnull should be the same as the argument type
|
||||
assert (fp.size() == 1);
|
||||
return fp[0]->data()->resultType();
|
||||
// operation type of MCS_isnull should be the same as the argument type
|
||||
assert (fp.size() == 1);
|
||||
return fp[0]->data()->resultType();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -293,33 +302,36 @@ CalpontSystemCatalog::ColType MCS_isnull::operationType (FunctionParm& fp,
|
||||
* This would be the most commonly called API for MCS_isnull function
|
||||
*/
|
||||
bool MCS_isnull::getBoolVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
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 MCS_isnull().
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
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 MCS_isnull().
|
||||
case CalpontSystemCatalog::DECIMAL:
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
parm[0]->data()->getDecimalVal(row, isNull);
|
||||
break;
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
parm[0]->data()->getStrVal(row, isNull);
|
||||
break;
|
||||
default:
|
||||
parm[0]->data()->getIntVal(row, isNull);
|
||||
}
|
||||
bool ret = isNull;
|
||||
// It's important to reset isNull indicator.
|
||||
isNull = false;
|
||||
return ret;
|
||||
parm[0]->data()->getDecimalVal(row, isNull);
|
||||
break;
|
||||
|
||||
case CalpontSystemCatalog::CHAR:
|
||||
case CalpontSystemCatalog::VARCHAR:
|
||||
parm[0]->data()->getStrVal(row, isNull);
|
||||
break;
|
||||
|
||||
default:
|
||||
parm[0]->data()->getIntVal(row, isNull);
|
||||
}
|
||||
|
||||
bool ret = isNull;
|
||||
// It's important to reset isNull indicator.
|
||||
isNull = false;
|
||||
return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -328,19 +340,19 @@ bool MCS_isnull::getBoolVal(Row& row,
|
||||
* This API is called when a double value is needed to return from the UDF function
|
||||
*/
|
||||
double MCS_isnull::getDoubleVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
}
|
||||
|
||||
float MCS_isnull::getFloatVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -348,54 +360,54 @@ float MCS_isnull::getFloatVal(Row& row,
|
||||
*
|
||||
* This API is called when an integer value is needed to return from the UDF function
|
||||
*
|
||||
* Because the result type MCS_add is double(real), all the other API can simply call
|
||||
* Because the result type MCS_add is double(real), all the other API can simply call
|
||||
* getDoubleVal and apply the conversion. This method may not fit for all the UDF
|
||||
* implementations.
|
||||
*/
|
||||
int64_t MCS_isnull::getIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
}
|
||||
|
||||
string MCS_isnull::getStrVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
// This needs to be more efficient if this API will be frequently
|
||||
// called for this UDF function.
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? "1" : "0");
|
||||
// This needs to be more efficient if this API will be frequently
|
||||
// called for this UDF function.
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? "1" : "0");
|
||||
|
||||
}
|
||||
|
||||
IDB_Decimal MCS_isnull::getDecimalVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
IDB_Decimal dec;
|
||||
dec.value = (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
dec.scale = 0;
|
||||
return dec;
|
||||
IDB_Decimal dec;
|
||||
dec.value = (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
dec.scale = 0;
|
||||
return dec;
|
||||
}
|
||||
|
||||
int32_t MCS_isnull::getDateIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
}
|
||||
|
||||
int64_t MCS_isnull::getDatetimeIntVal(Row& row,
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
FunctionParm& parm,
|
||||
bool& isNull,
|
||||
CalpontSystemCatalog::ColType& op_ct)
|
||||
{
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
return (getBoolVal(row, parm, isNull, op_ct) ? 1 : 0);
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user