You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-08-07 03:22:57 +03:00
MCOL-392 Fix microsecond and nullif for TIME
This commit is contained in:
@@ -63,6 +63,11 @@ int64_t Func_microsecond::getIntVal(rowgroup::Row& row,
|
|||||||
microSecond = (uint32_t)((val & 0xfffff));
|
microSecond = (uint32_t)((val & 0xfffff));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case CalpontSystemCatalog::TIME:
|
||||||
|
val = parm[0]->data()->getIntVal(row, isNull);
|
||||||
|
microSecond = (uint32_t)((val & 0xffffff));
|
||||||
|
break;
|
||||||
|
|
||||||
case CalpontSystemCatalog::CHAR:
|
case CalpontSystemCatalog::CHAR:
|
||||||
case CalpontSystemCatalog::TEXT:
|
case CalpontSystemCatalog::TEXT:
|
||||||
case CalpontSystemCatalog::VARCHAR:
|
case CalpontSystemCatalog::VARCHAR:
|
||||||
|
@@ -127,8 +127,11 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row,
|
|||||||
{
|
{
|
||||||
exp2 = parm[1]->data()->getDatetimeIntVal(row, isNull);
|
exp2 = parm[1]->data()->getDatetimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (parm[0]->data()->resultType().colDataType ==
|
if ((parm[0]->data()->resultType().colDataType ==
|
||||||
execplan::CalpontSystemCatalog::DATE)
|
execplan::CalpontSystemCatalog::DATE) ||
|
||||||
|
(parm[0]->data()->resultType().colDataType ==
|
||||||
|
execplan::CalpontSystemCatalog::DATETIME))
|
||||||
|
|
||||||
{
|
{
|
||||||
// NULLIF arg0 is DATE, arg1 is DATETIME,
|
// NULLIF arg0 is DATE, arg1 is DATETIME,
|
||||||
// Upgrade arg1 to datetime
|
// Upgrade arg1 to datetime
|
||||||
@@ -159,8 +162,10 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row,
|
|||||||
{
|
{
|
||||||
exp2 = parm[1]->data()->getTimeIntVal(row, isNull);
|
exp2 = parm[1]->data()->getTimeIntVal(row, isNull);
|
||||||
|
|
||||||
if (parm[0]->data()->resultType().colDataType ==
|
if ((parm[0]->data()->resultType().colDataType ==
|
||||||
execplan::CalpontSystemCatalog::DATETIME)
|
execplan::CalpontSystemCatalog::DATETIME) ||
|
||||||
|
(parm[0]->data()->resultType().colDataType ==
|
||||||
|
execplan::CalpontSystemCatalog::TIME))
|
||||||
{
|
{
|
||||||
// NULLIF arg0 is DATETIME, arg1 is TIME,
|
// NULLIF arg0 is DATETIME, arg1 is TIME,
|
||||||
// Upgrade arg1 to time
|
// Upgrade arg1 to time
|
||||||
@@ -445,18 +450,6 @@ int64_t Func_nullif::getDatetimeIntVal(rowgroup::Row& row,
|
|||||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||||
case execplan::CalpontSystemCatalog::CHAR:
|
case execplan::CalpontSystemCatalog::CHAR:
|
||||||
case execplan::CalpontSystemCatalog::TEXT:
|
case execplan::CalpontSystemCatalog::TEXT:
|
||||||
{
|
|
||||||
exp2 = parm[1]->data()->getIntVal(row, isNull);
|
|
||||||
|
|
||||||
if (isNull)
|
|
||||||
{
|
|
||||||
isNull = false;
|
|
||||||
return exp1;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case execplan::CalpontSystemCatalog::DATE:
|
case execplan::CalpontSystemCatalog::DATE:
|
||||||
{
|
{
|
||||||
// Upgrade to datetime for proper comparison
|
// Upgrade to datetime for proper comparison
|
||||||
@@ -522,18 +515,6 @@ int64_t Func_nullif::getTimeIntVal(rowgroup::Row& row,
|
|||||||
case execplan::CalpontSystemCatalog::VARCHAR:
|
case execplan::CalpontSystemCatalog::VARCHAR:
|
||||||
case execplan::CalpontSystemCatalog::CHAR:
|
case execplan::CalpontSystemCatalog::CHAR:
|
||||||
case execplan::CalpontSystemCatalog::TEXT:
|
case execplan::CalpontSystemCatalog::TEXT:
|
||||||
{
|
|
||||||
exp2 = parm[1]->data()->getIntVal(row, isNull);
|
|
||||||
|
|
||||||
if (isNull)
|
|
||||||
{
|
|
||||||
isNull = false;
|
|
||||||
return exp1;
|
|
||||||
}
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case execplan::CalpontSystemCatalog::TIME:
|
case execplan::CalpontSystemCatalog::TIME:
|
||||||
case execplan::CalpontSystemCatalog::DATETIME:
|
case execplan::CalpontSystemCatalog::DATETIME:
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user