From 0d292e2b788296ddb569c2f9fdf4b4895dec5370 Mon Sep 17 00:00:00 2001 From: Andrew Hutchings Date: Tue, 4 Oct 2016 17:23:10 +0100 Subject: [PATCH] MCOL-347 Fix NULLIF() for DATETIME with DATE Comparing DATETIME with DATE compared two different date int formats --- utils/funcexp/func_nullif.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/funcexp/func_nullif.cpp b/utils/funcexp/func_nullif.cpp index 9db0f8e5b..4c12f2a6b 100644 --- a/utils/funcexp/func_nullif.cpp +++ b/utils/funcexp/func_nullif.cpp @@ -362,7 +362,8 @@ int64_t Func_nullif::getDatetimeIntVal(rowgroup::Row& row, } case execplan::CalpontSystemCatalog::DATE: { - exp2 = parm[1]->data()->getDateIntVal(row, isNull); + // Upgrade to datetime for proper comparison + exp2 = parm[1]->data()->getDatetimeIntVal(row, isNull); if (isNull) { isNull = false; return exp1;