1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +03:00

MCOL-4671: MCOL-4622: fix the behavior of both PRs

first was playing different with RIGHT and LEFT functions(using the getUintVal and getIntVal accordingly)
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3234
second introduced round for ints from double, but added it to uint but not to int missing long doubles as well
https://github.com/mariadb-corporation/mariadb-columnstore-engine/pull/3480
This commit is contained in:
Leonid Fedorov
2025-05-22 19:07:45 +00:00
committed by Leonid Fedorov
parent 842ec9dbff
commit 5814a80b50
5 changed files with 68 additions and 33 deletions

View File

@ -720,12 +720,12 @@ inline int64_t TreeNode::getIntVal()
case CalpontSystemCatalog::UINT: return fResult.uintVal;
case CalpontSystemCatalog::FLOAT:
case CalpontSystemCatalog::UFLOAT: return (int64_t)fResult.floatVal;
case CalpontSystemCatalog::UFLOAT: return (int64_t)std::llround(fResult.floatVal);
case CalpontSystemCatalog::DOUBLE:
case CalpontSystemCatalog::UDOUBLE: return (int64_t)fResult.doubleVal;
case CalpontSystemCatalog::UDOUBLE: return (int64_t)std::llround(fResult.doubleVal);
case CalpontSystemCatalog::LONGDOUBLE: return (int64_t)fResult.longDoubleVal;
case CalpontSystemCatalog::LONGDOUBLE: return (int64_t)std::llround(fResult.longDoubleVal);
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL: return fResult.decimalVal.toSInt64Round();
@ -776,7 +776,7 @@ inline uint64_t TreeNode::getUintVal()
case CalpontSystemCatalog::DOUBLE:
case CalpontSystemCatalog::UDOUBLE: return (uint64_t)std::llround(fResult.doubleVal);
case CalpontSystemCatalog::LONGDOUBLE: return (uint64_t)fResult.longDoubleVal;
case CalpontSystemCatalog::LONGDOUBLE: return (uint64_t)std::llround(fResult.longDoubleVal);
case CalpontSystemCatalog::DECIMAL:
case CalpontSystemCatalog::UDECIMAL: return fResult.decimalVal.toUInt64Round();