From 92cb6345fb16cff3db76fa373a3381c630d4e27f Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Mon, 4 Jun 2018 22:03:50 +0100 Subject: [PATCH] MCOL-1428 Fix SUBTIME() with day in WHERE SUBTIME() with day number used the DATETIME funciton instead of TIME so got stuck in an endless loop. Now uses the TIME calculations instead. --- utils/funcexp/func_add_time.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/utils/funcexp/func_add_time.cpp b/utils/funcexp/func_add_time.cpp index c3d5d7d85..edd05c6d4 100644 --- a/utils/funcexp/func_add_time.cpp +++ b/utils/funcexp/func_add_time.cpp @@ -223,7 +223,14 @@ int64_t Func_add_time::getIntVal(rowgroup::Row& row, bool& isNull, CalpontSystemCatalog::ColType& op_ct) { - return getDatetimeIntVal(row, parm, isNull, op_ct); + if (parm[0]->data()->resultType().colDataType == execplan::CalpontSystemCatalog::TIME) + { + return getTimeIntVal(row, parm, isNull, op_ct); + } + else + { + return getDatetimeIntVal(row, parm, isNull, op_ct); + } } string Func_add_time::getStrVal(rowgroup::Row& row,