You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-30 19:23:07 +03:00
MCOL-4409 Moved static Decimal conversion methods into VDecimal class
MCOL-4409 This patch combines VDecimal and Decimal and makes IDB_Decimal an alias for the result class MCOL-4409 More boilerplate reduction in Func_mod Removed couple TSInt128::toType() methods
This commit is contained in:
@ -55,24 +55,7 @@ namespace execplan
|
||||
{
|
||||
|
||||
typedef execplan::CalpontSystemCatalog::ColType Type;
|
||||
|
||||
|
||||
class IDB_Decimal: public datatypes::VDecimal
|
||||
{
|
||||
public:
|
||||
IDB_Decimal() = default;
|
||||
IDB_Decimal(int64_t val, int8_t s, uint8_t p, const int128_t &val128 = 0) :
|
||||
VDecimal(val, s, p, val128) {}
|
||||
|
||||
inline void operator=(const datatypes::TSInt128& rhs)
|
||||
{
|
||||
value = 0; scale = 0; precision = 0;
|
||||
datatypes::TSInt128::operator=(rhs);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
typedef IDB_Decimal CNX_Decimal;
|
||||
typedef datatypes::Decimal IDB_Decimal;
|
||||
|
||||
/**
|
||||
* @brief IDB_Regex struct
|
||||
@ -728,13 +711,7 @@ inline int64_t TreeNode::getIntVal()
|
||||
{
|
||||
if (fResultType.colWidth == datatypes::MAXDECIMALWIDTH)
|
||||
{
|
||||
int128_t scaleDivisor;
|
||||
|
||||
datatypes::getScaleDivisor(scaleDivisor, fResult.decimalVal.scale);
|
||||
|
||||
int128_t tmpval = fResult.decimalVal.s128Value / scaleDivisor;
|
||||
|
||||
return datatypes::Decimal::getInt64FromWideDecimal(tmpval);
|
||||
return static_cast<int64_t>(fResult.decimalVal.getIntegralPart());
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user