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

MCOL-641 Ternary operation with different datatype of the two

resulting expressions cannot be used as a template argument.
This is because the template instantiation happens at compile time
and cannot depend on the runtime value of the evaluating expression.
This commit is contained in:
Gagan Goel
2020-08-27 12:51:00 -04:00
committed by Roman Nozdrin
parent 1c3a34a3d0
commit 88e106f018
2 changed files with 6 additions and 20 deletions

View File

@ -156,16 +156,6 @@ inline void getScaleDivisor(T& divisor, const int8_t scale)
} }
} }
/**
@brief The template to generalise common math operation
execution path using struct from <functional>.
*/
template<typename BinaryOperation, typename OverflowCheck>
void execute(const execplan::IDB_Decimal& l,
const execplan::IDB_Decimal& r,
execplan::IDB_Decimal& result,
BinaryOperation op,
OverflowCheck overflowCheck);
/** /**
@brief Contains subset of decimal related operations. @brief Contains subset of decimal related operations.

View File

@ -829,9 +829,8 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
// Merge input min/max with current min/max // Merge input min/max with current min/max
case CP_VALID: case CP_VALID:
{ {
if (!isValidCPRange( !isBinaryColumn ? it->second.max : it->second.bigMax, if ((!isBinaryColumn && !isValidCPRange(it->second.max, it->second.min, it->second.type)) ||
!isBinaryColumn ? it->second.min : it->second.bigMin, (isBinaryColumn && !isValidCPRange(it->second.bigMax, it->second.bigMin, it->second.type)))
it->second.type ))
{ {
break; break;
} }
@ -843,10 +842,8 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
// having all NULL values, in which case the current // having all NULL values, in which case the current
// min/max needs to be set instead of merged. // min/max needs to be set instead of merged.
if (isValidCPRange( if ((!isBinaryColumn && isValidCPRange(fExtentMap[i].partition.cprange.hiVal, fExtentMap[i].partition.cprange.loVal, it->second.type)) ||
!isBinaryColumn ? fExtentMap[i].partition.cprange.hiVal : fExtentMap[i].partition.cprange.bigHiVal, (isBinaryColumn && isValidCPRange(fExtentMap[i].partition.cprange.bigHiVal, fExtentMap[i].partition.cprange.bigLoVal, it->second.type)))
!isBinaryColumn ? fExtentMap[i].partition.cprange.loVal : fExtentMap[i].partition.cprange.bigLoVal,
it->second.type))
{ {
// Swap byte order to do binary string comparison // Swap byte order to do binary string comparison
if (isCharType(it->second.type)) if (isCharType(it->second.type))
@ -981,9 +978,8 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
if (it->second.newExtent) if (it->second.newExtent)
{ {
if (isValidCPRange( !isBinaryColumn ? it->second.max : it->second.bigMax, if ((!isBinaryColumn && isValidCPRange(it->second.max, it->second.min, it->second.type)) ||
!isBinaryColumn ? it->second.min : it->second.bigMin, (isBinaryColumn && isValidCPRange(it->second.bigMax, it->second.bigMin, it->second.type)))
it->second.type ))
{ {
if (!isBinaryColumn) if (!isBinaryColumn)
{ {