You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-29 08:21:15 +03:00
MCOL-641 Initial version of Math operations for wide decimal.
This commit is contained in:
@ -42,6 +42,8 @@ using namespace joblist;
|
||||
#include "../udfsdk/udfsdk.h"
|
||||
#endif
|
||||
|
||||
#include "mcs_decimal.h"
|
||||
|
||||
namespace funcexp
|
||||
{
|
||||
|
||||
@ -471,13 +473,22 @@ void FuncExp::evaluate(rowgroup::Row& row, std::vector<execplan::SRCP>& expressi
|
||||
case CalpontSystemCatalog::UDECIMAL:
|
||||
{
|
||||
IDB_Decimal val = expression[i]->getDecimalVal(row, isNull);
|
||||
|
||||
// WIP check for null and overflow here.
|
||||
if (expression[i]->resultType().colWidth == 16)
|
||||
if (expression[i]->resultType().colWidth
|
||||
== datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
row.setBinaryField_offset(&val.s128Value,
|
||||
expression[i]->resultType().colWidth,
|
||||
row.getOffset(expression[i]->outputIndex()));
|
||||
if (isNull)
|
||||
{
|
||||
row.setBinaryField_offset(
|
||||
const_cast<int128_t*>(&datatypes::Decimal128Null),
|
||||
expression[i]->resultType().colWidth,
|
||||
row.getOffset(expression[i]->outputIndex()));
|
||||
}
|
||||
else
|
||||
{
|
||||
row.setBinaryField_offset(&val.s128Value,
|
||||
expression[i]->resultType().colWidth,
|
||||
row.getOffset(expression[i]->outputIndex()));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user