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
Merge branch 'mariadb-corporation:develop' into develop
This commit is contained in:
@ -143,7 +143,7 @@ int64_t Func_cast_signed::getIntVal(Row& row, FunctionParm& parm, bool& isNull,
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
const string& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
const auto& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
@ -151,7 +151,7 @@ int64_t Func_cast_signed::getIntVal(Row& row, FunctionParm& parm, bool& isNull,
|
||||
return 0;
|
||||
}
|
||||
|
||||
return atoll(value.c_str());
|
||||
return atoll(value.str());
|
||||
}
|
||||
break;
|
||||
|
||||
@ -259,7 +259,7 @@ uint64_t Func_cast_unsigned::getUintVal(Row& row, FunctionParm& parm, bool& isNu
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
const string& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
const auto& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
@ -267,7 +267,7 @@ uint64_t Func_cast_unsigned::getUintVal(Row& row, FunctionParm& parm, bool& isNu
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t ret = strtoul(value.c_str(), 0, 0);
|
||||
uint64_t ret = strtoul(value.str(), 0, 0);
|
||||
return ret;
|
||||
}
|
||||
break;
|
||||
@ -336,14 +336,14 @@ string Func_cast_char::getStrVal(Row& row, FunctionParm& parm, bool& isNull,
|
||||
{
|
||||
// check for convert with 1 arg, return the argument
|
||||
if (parm.size() == 1)
|
||||
return parm[0]->data()->getStrVal(row, isNull);
|
||||
return parm[0]->data()->getStrVal(row, isNull).safeString("");
|
||||
;
|
||||
|
||||
int64_t length = parm[1]->data()->getIntVal(row, isNull);
|
||||
|
||||
// @bug3488, a dummy parm is appended even the optional N is not present.
|
||||
if (length < 0)
|
||||
return parm[0]->data()->getStrVal(row, isNull);
|
||||
return parm[0]->data()->getStrVal(row, isNull).safeString("");
|
||||
;
|
||||
|
||||
switch (parm[0]->data()->resultType().colDataType)
|
||||
@ -392,15 +392,15 @@ string Func_cast_char::getStrVal(Row& row, FunctionParm& parm, bool& isNull,
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
const string& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
const utils::NullString& value = parm[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
if (isNull)
|
||||
{
|
||||
isNull = true;
|
||||
return value;
|
||||
return string("");
|
||||
}
|
||||
|
||||
return value.substr(0, length);
|
||||
return value.safeString("").substr(0, length);
|
||||
}
|
||||
break;
|
||||
|
||||
@ -549,7 +549,7 @@ int32_t Func_cast_date::getDateIntVal(rowgroup::Row& row, FunctionParm& parm, bo
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToDate(parm[0]->data()->getStrVal(row, isNull));
|
||||
val = dataconvert::DataConvert::stringToDate(parm[0]->data()->getStrVal(row, isNull).safeString(""));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
@ -659,7 +659,7 @@ int64_t Func_cast_date::getDatetimeIntVal(rowgroup::Row& row, FunctionParm& parm
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull));
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString(""));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
@ -821,7 +821,7 @@ int64_t Func_cast_datetime::getDatetimeIntVal(rowgroup::Row& row, FunctionParm&
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull));
|
||||
val = dataconvert::DataConvert::stringToDatetime(parm[0]->data()->getStrVal(row, isNull).safeString(""));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
@ -932,7 +932,7 @@ int64_t Func_cast_datetime::getTimeIntVal(rowgroup::Row& row, FunctionParm& parm
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
val = dataconvert::DataConvert::stringToTime(parm[0]->data()->getStrVal(row, isNull));
|
||||
val = dataconvert::DataConvert::stringToTime(parm[0]->data()->getStrVal(row, isNull).safeString(""));
|
||||
|
||||
if (val == -1)
|
||||
isNull = true;
|
||||
@ -1072,7 +1072,6 @@ IDB_Decimal Func_cast_decimal::getDecimalVal(Row& row, FunctionParm& parm, bool&
|
||||
if (decimal.isTSInt128ByPrecision())
|
||||
{
|
||||
int128_t max_number_decimal = datatypes::ConversionRangeMaxValue[max_length - 19];
|
||||
|
||||
uint128_t uval = parm[0]->data()->getUintVal(row, isNull);
|
||||
|
||||
if (uval > (uint128_t)datatypes::Decimal::maxInt128)
|
||||
@ -1286,14 +1285,14 @@ IDB_Decimal Func_cast_decimal::getDecimalVal(Row& row, FunctionParm& parm, bool&
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
const string& strValue = parm[0]->data()->getStrVal(row, isNull);
|
||||
if (strValue.empty())
|
||||
const utils::NullString& strValue = parm[0]->data()->getStrVal(row, isNull);
|
||||
if (strValue.isNull())
|
||||
{
|
||||
isNull = true;
|
||||
return IDB_Decimal(); // need a null value for IDB_Decimal??
|
||||
}
|
||||
datatypes::DataCondition convError;
|
||||
return IDB_Decimal(strValue.data(), strValue.length(), convError, decimals, max_length);
|
||||
return IDB_Decimal(strValue.str(), strValue.length(), convError, decimals, max_length);
|
||||
}
|
||||
|
||||
break;
|
||||
@ -1515,9 +1514,9 @@ double Func_cast_double::getDoubleVal(Row& row, FunctionParm& parm, bool& isNull
|
||||
case execplan::CalpontSystemCatalog::CHAR:
|
||||
case execplan::CalpontSystemCatalog::TEXT:
|
||||
{
|
||||
const string& strValue = parm[0]->data()->getStrVal(row, isNull);
|
||||
const utils::NullString& strValue = parm[0]->data()->getStrVal(row, isNull);
|
||||
|
||||
dblval = strtod(strValue.c_str(), NULL);
|
||||
dblval = strtod(strValue.str(), NULL);
|
||||
}
|
||||
break;
|
||||
|
||||
|
Reference in New Issue
Block a user