diff --git a/utils/funcexp/func_microsecond.cpp b/utils/funcexp/func_microsecond.cpp index e0a8e6d11..f292e26a5 100644 --- a/utils/funcexp/func_microsecond.cpp +++ b/utils/funcexp/func_microsecond.cpp @@ -63,6 +63,11 @@ int64_t Func_microsecond::getIntVal(rowgroup::Row& row, microSecond = (uint32_t)((val & 0xfffff)); break; + case CalpontSystemCatalog::TIME: + val = parm[0]->data()->getIntVal(row, isNull); + microSecond = (uint32_t)((val & 0xffffff)); + break; + case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::VARCHAR: diff --git a/utils/funcexp/func_nullif.cpp b/utils/funcexp/func_nullif.cpp index 23362f4ef..30d4682e5 100644 --- a/utils/funcexp/func_nullif.cpp +++ b/utils/funcexp/func_nullif.cpp @@ -127,8 +127,11 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row, { exp2 = parm[1]->data()->getDatetimeIntVal(row, isNull); - if (parm[0]->data()->resultType().colDataType == - execplan::CalpontSystemCatalog::DATE) + if ((parm[0]->data()->resultType().colDataType == + execplan::CalpontSystemCatalog::DATE) || + (parm[0]->data()->resultType().colDataType == + execplan::CalpontSystemCatalog::DATETIME)) + { // NULLIF arg0 is DATE, arg1 is DATETIME, // Upgrade arg1 to datetime @@ -159,8 +162,10 @@ int64_t Func_nullif::getIntVal(rowgroup::Row& row, { exp2 = parm[1]->data()->getTimeIntVal(row, isNull); - if (parm[0]->data()->resultType().colDataType == - execplan::CalpontSystemCatalog::DATETIME) + if ((parm[0]->data()->resultType().colDataType == + execplan::CalpontSystemCatalog::DATETIME) || + (parm[0]->data()->resultType().colDataType == + execplan::CalpontSystemCatalog::TIME)) { // NULLIF arg0 is DATETIME, arg1 is TIME, // Upgrade arg1 to time @@ -445,18 +450,6 @@ int64_t Func_nullif::getDatetimeIntVal(rowgroup::Row& row, case execplan::CalpontSystemCatalog::VARCHAR: case execplan::CalpontSystemCatalog::CHAR: case execplan::CalpontSystemCatalog::TEXT: - { - exp2 = parm[1]->data()->getIntVal(row, isNull); - - if (isNull) - { - isNull = false; - return exp1; - } - - break; - } - case execplan::CalpontSystemCatalog::DATE: { // 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::CHAR: 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::DATETIME: {