1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

MCOL-2230 Fix TIMEDIFF() handling

TIMEDIFF would not compare datetime with string correctly, causing a
NULL saturation.
This commit is contained in:
Andrew Hutchings
2019-06-10 16:46:24 +01:00
parent f8b834c8ec
commit 0983c1becf

View File

@ -118,7 +118,10 @@ string Func_timediff::getStrVal(rowgroup::Row& row,
case execplan::CalpontSystemCatalog::TIME:
case execplan::CalpontSystemCatalog::DATETIME:
if (type1 != type2)
// Diff between time and datetime returns NULL in MariaDB
if ((type2 == execplan::CalpontSystemCatalog::TIME ||
type2 == execplan::CalpontSystemCatalog::DATETIME) &&
type1 != type2)
{
isNull = true;
break;