1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-641 Refactored MultiplicationOverflowCheck but it still has flaws.

Introduced fDecimalOverflowCheck to enable/disable overflow check.

Add support into a FunctionColumn.

Low level scanning crashes on medium sized data sets.
This commit is contained in:
Roman Nozdrin
2020-03-24 13:41:28 +00:00
parent 74b64eb4f1
commit b5534eb847
13 changed files with 528 additions and 36 deletions

View File

@ -196,6 +196,14 @@ public:
return TreeNode::getBoolVal();
}
void adjustResultType(const CalpontSystemCatalog::ColType& m);
constexpr inline bool getOverflowCheck()
{
return fDecimalOverflowCheck;
}
inline void setOverflowCheck(bool check)
{
fDecimalOverflowCheck = check;
}
private:
template <typename result_t>
@ -203,6 +211,7 @@ private:
inline void execute(IDB_Decimal& result, IDB_Decimal op1, IDB_Decimal op2, bool& isNull);
inline void execute(IDB_Decimal& result, IDB_Decimal op1, IDB_Decimal op2, bool& isNull, cscType& resultCscType);
std::string fTimeZone;
bool fDecimalOverflowCheck;
};
#include "parsetree.h"
@ -288,12 +297,12 @@ inline void ArithmeticOperator::execute(IDB_Decimal& result, IDB_Decimal op1, ID
switch (fOp)
{
case OP_ADD:
if (resultCscType.colWidth == 16)
if (resultCscType.colWidth == datatypes::MAXDECIMALWIDTH)
{
datatypes::Decimal::addition<decltype(result.s128Value),false>(
datatypes::Decimal::addition<decltype(result.s128Value),true>(
op1, op2, result);
}
else if (resultCscType.colWidth == 8)
else if (resultCscType.colWidth == utils::MAXLEGACYWIDTH)
{
datatypes::Decimal::addition<decltype(result.value),false>(
op1, op2, result);