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

Renamed datatypes/decimal.* into csdecimal to avoid collision with MDB.

This commit is contained in:
Roman Nozdrin
2020-03-05 03:27:17 +00:00
parent 238386bf63
commit 2e8e7d52c3
9 changed files with 133 additions and 28 deletions

View File

@ -1,5 +1,5 @@
include_directories( ${ENGINE_COMMON_INCLUDES} ${ENGINE_UTILS_UDFSDK_INCLUDE} )
include_directories( ${ENGINE_COMMON_INCLUDES} ${ENGINE_UTILS_UDFSDK_INCLUDE} ${ENGINE_DATATYPES_INCLUDE})
########### next target ###############

View File

@ -35,6 +35,8 @@
#include "calpontsystemcatalog.h"
#include "exceptclasses.h"
#include "dataconvert.h"
#include "columnwidth.h"
#include "csdecimal.h"
using int128_t = __int128;
@ -116,45 +118,105 @@ struct IDB_Decimal
bool operator==(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value == rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value == rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) == 0);
}
else
return (decimalComp(rhs) == 0);
{
if (scale == rhs.scale)
return value == rhs.value;
else
return (decimalComp(rhs) == 0);
}
}
bool operator>(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value > rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value > rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) > 0);
}
else
return (decimalComp(rhs) > 0);
{
if (scale == rhs.scale)
return value > rhs.value;
else
return (decimalComp(rhs) > 0);
}
}
bool operator<(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value < rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value < rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) < 0);
}
else
return (decimalComp(rhs) < 0);
{
if (scale == rhs.scale)
return value < rhs.value;
else
return (decimalComp(rhs) < 0);
}
}
bool operator>=(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value >= rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value >= rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) >= 0);
}
else
return (decimalComp(rhs) >= 0);
{
if (scale == rhs.scale)
return value >= rhs.value;
else
return (decimalComp(rhs) >= 0);
}
}
bool operator<=(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value <= rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value <= rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) <= 0);
}
else
return (decimalComp(rhs) <= 0);
{
if (scale == rhs.scale)
return value <= rhs.value;
else
return (decimalComp(rhs) <= 0);
}
}
bool operator!=(const IDB_Decimal& rhs) const
{
if (scale == rhs.scale)
return value != rhs.value;
if (utils::widthByPrecision(precision) == 16)
{
if (scale == rhs.scale)
return s128Value != rhs.s128Value;
else
return (datatypes::Decimal::compare(*this, rhs) != 0);
}
else
return (decimalComp(rhs) != 0);
{
if (scale == rhs.scale)
return value != rhs.value;
else
return (decimalComp(rhs) != 0);
}
}
int128_t s128Value;