diff --git a/utils/funcexp/func_ceil.cpp b/utils/funcexp/func_ceil.cpp index f9f9c1891..b41a0b93e 100644 --- a/utils/funcexp/func_ceil.cpp +++ b/utils/funcexp/func_ceil.cpp @@ -143,37 +143,25 @@ int64_t Func_ceil::getIntVal(Row& row, case CalpontSystemCatalog::DATE: { - Date d (parm[0]->data()->getDateIntVal(row, isNull)); - - if (!isNull) - ret = d.convertToMySQLint(); + ret = parm[0]->data()->getDateIntVal(row, isNull); } break; case CalpontSystemCatalog::DATETIME: { - DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(); + ret = parm[0]->data()->getDatetimeIntVal(row, isNull); } break; case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(timeZone()); + ret = parm[0]->data()->getTimestampIntVal(row, isNull); } break; case CalpontSystemCatalog::TIME: { - Time dt(parm[0]->data()->getTimeIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(); + ret = parm[0]->data()->getTimeIntVal(row, isNull); } break; @@ -248,8 +236,10 @@ uint64_t Func_ceil::getUintVal(Row& row, case CalpontSystemCatalog::DATE: { + // For some reason, MDB doesn't return this as a date, + // but datetime is returned as a datetime. Expect + // this to change in the future. Date d (parm[0]->data()->getDateIntVal(row, isNull)); - if (!isNull) ret = d.convertToMySQLint(); } @@ -257,28 +247,19 @@ uint64_t Func_ceil::getUintVal(Row& row, case CalpontSystemCatalog::DATETIME: { - DateTime dt(parm[0]->data()->getDatetimeIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(); + ret = parm[0]->data()->getDatetimeIntVal(row, isNull); } break; case CalpontSystemCatalog::TIMESTAMP: { - TimeStamp dt(parm[0]->data()->getTimestampIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(timeZone()); + ret = parm[0]->data()->getTimestampIntVal(row, isNull); } break; case CalpontSystemCatalog::TIME: { - Time dt(parm[0]->data()->getTimeIntVal(row, isNull)); - - if (!isNull) - ret = dt.convertToMySQLint(); + ret = parm[0]->data()->getTimeIntVal(row, isNull); } break;