You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2025-07-27 21:01:50 +03:00
A pack of fixes for compilation errors and warnings for all platforms
Add libdatatypes.so into debian packaging
This commit is contained in:
@ -25,9 +25,9 @@ local platformMap(branch, platform) =
|
|||||||
};
|
};
|
||||||
|
|
||||||
local platform_map = {
|
local platform_map = {
|
||||||
'opensuse/leap:15': 'zypper ' + rpm_build_deps + ' cmake libboost_system-devel libboost_filesystem-devel libboost_thread-devel libboost_regex-devel libboost_date_time-devel libboost_chrono-devel libboost_atomic-devel libquadmath0 && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=sles15 && make -j$(nproc) package',
|
'opensuse/leap:15': 'zypper ' + rpm_build_deps + ' cmake libboost_system-devel libboost_filesystem-devel libboost_thread-devel libboost_regex-devel libboost_date_time-devel libboost_chrono-devel libboost_atomic-devel gcc-fortran && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=sles15 && make -j$(nproc) package',
|
||||||
'centos:7': 'yum install -y epel-release && yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake && yum ' + rpm_build_deps + ' libquadmath && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=centos7 && make -j$(nproc) package',
|
'centos:7': 'yum install -y epel-release && yum install -y cmake3 && ln -s /usr/bin/cmake3 /usr/bin/cmake && yum ' + rpm_build_deps + ' libquadmath libquadmath-devel && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=centos7 && make -j$(nproc) package',
|
||||||
'centos:8': "yum install -y libgcc && sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-PowerTools.repo && yum " + rpm_build_deps + ' cmake libquadmath && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=centos8 && make -j$(nproc) package',
|
'centos:8': "yum install -y libgcc && sed -i 's/enabled=0/enabled=1/' /etc/yum.repos.d/CentOS-PowerTools.repo && yum " + rpm_build_deps + ' cmake libquadmath libquadmath-devel && cmake ' + cmakeflags + branch_cmakeflags_map[branch] + ' -DRPM=centos8 && make -j$(nproc) package',
|
||||||
'debian:9': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=stretch' debian/autobake-deb.sh",
|
'debian:9': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=stretch' debian/autobake-deb.sh",
|
||||||
'debian:10': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=buster' debian/autobake-deb.sh",
|
'debian:10': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=buster' debian/autobake-deb.sh",
|
||||||
'ubuntu:16.04': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=xenial' debian/autobake-deb.sh",
|
'ubuntu:16.04': deb_build_deps + " && CMAKEFLAGS='" + cmakeflags + branch_cmakeflags_map[branch] + " -DDEB=xenial' debian/autobake-deb.sh",
|
||||||
|
@ -346,13 +346,13 @@ TypeHandler::find(SystemCatalog::ColDataType typeCode,
|
|||||||
case SystemCatalog::UDOUBLE: return &mcs_type_handler_udouble;
|
case SystemCatalog::UDOUBLE: return &mcs_type_handler_udouble;
|
||||||
|
|
||||||
case SystemCatalog::DECIMAL:
|
case SystemCatalog::DECIMAL:
|
||||||
if (ct.colWidth < datatypes::MAXDECIMALWIDTH)
|
if (static_cast<uint32_t>(ct.colWidth) < datatypes::MAXDECIMALWIDTH)
|
||||||
return &mcs_type_handler_sdecimal64;
|
return &mcs_type_handler_sdecimal64;
|
||||||
else
|
else
|
||||||
return &mcs_type_handler_sdecimal128;
|
return &mcs_type_handler_sdecimal128;
|
||||||
|
|
||||||
case SystemCatalog::UDECIMAL:
|
case SystemCatalog::UDECIMAL:
|
||||||
if (ct.colWidth < datatypes::MAXDECIMALWIDTH)
|
if (static_cast<uint32_t>(ct.colWidth) < datatypes::MAXDECIMALWIDTH)
|
||||||
return &mcs_type_handler_udecimal64;
|
return &mcs_type_handler_udecimal64;
|
||||||
else
|
else
|
||||||
return &mcs_type_handler_udecimal128;
|
return &mcs_type_handler_udecimal128;
|
||||||
@ -1303,7 +1303,7 @@ TypeHandlerStr::toSimpleValue(const SessionParam &sp,
|
|||||||
/****************************************************************************/
|
/****************************************************************************/
|
||||||
|
|
||||||
MinMaxPartitionInfo::MinMaxPartitionInfo(const BRM::EMEntry &entry)
|
MinMaxPartitionInfo::MinMaxPartitionInfo(const BRM::EMEntry &entry)
|
||||||
:m_status(entry.status == BRM::EXTENTOUTOFSERVICE ? ET_DISABLED : 0)
|
:m_status(entry.status == BRM::EXTENTOUTOFSERVICE ? ET_DISABLED : EXPL_NULL)
|
||||||
{ }
|
{ }
|
||||||
|
|
||||||
|
|
||||||
|
@ -582,6 +582,7 @@ class MinMaxPartitionInfo: public MinMaxInfo
|
|||||||
{
|
{
|
||||||
enum status_flag_t : uint64_t
|
enum status_flag_t : uint64_t
|
||||||
{
|
{
|
||||||
|
EXPL_NULL = 0x0000,
|
||||||
ET_DISABLED = 0x0002,
|
ET_DISABLED = 0x0002,
|
||||||
CPINVALID = 0x0004
|
CPINVALID = 0x0004
|
||||||
};
|
};
|
||||||
|
@ -72,6 +72,7 @@ namespace datatypes
|
|||||||
{
|
{
|
||||||
|
|
||||||
using int128_t = __int128;
|
using int128_t = __int128;
|
||||||
|
using uint128_t = unsigned __int128;
|
||||||
|
|
||||||
|
|
||||||
// Type traits
|
// Type traits
|
||||||
@ -90,6 +91,26 @@ struct is_allowed_numeric<int128_t> {
|
|||||||
static const bool value = true;
|
static const bool value = true;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct is_int128_t {
|
||||||
|
static const bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct is_int128_t<int128_t> {
|
||||||
|
static const bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
template <typename T>
|
||||||
|
struct is_uint128_t {
|
||||||
|
static const bool value = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<>
|
||||||
|
struct is_uint128_t<uint128_t> {
|
||||||
|
static const bool value = true;
|
||||||
|
};
|
||||||
|
|
||||||
// The method converts a __float128 s128Value to a double.
|
// The method converts a __float128 s128Value to a double.
|
||||||
static inline double getDoubleFromFloat128(const __float128& value)
|
static inline double getDoubleFromFloat128(const __float128& value)
|
||||||
{
|
{
|
||||||
|
@ -196,7 +196,7 @@ public:
|
|||||||
return TreeNode::getBoolVal();
|
return TreeNode::getBoolVal();
|
||||||
}
|
}
|
||||||
void adjustResultType(const CalpontSystemCatalog::ColType& m);
|
void adjustResultType(const CalpontSystemCatalog::ColType& m);
|
||||||
const inline bool getOverflowCheck() const
|
inline bool getOverflowCheck() const
|
||||||
{
|
{
|
||||||
return fDecimalOverflowCheck;
|
return fDecimalOverflowCheck;
|
||||||
}
|
}
|
||||||
|
@ -6119,6 +6119,26 @@ CalpontSystemCatalog::ColType::ColType(const ColType& rhs)
|
|||||||
cs = rhs.cs;
|
cs = rhs.cs;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
CalpontSystemCatalog::ColType& CalpontSystemCatalog::ColType::operator=(const ColType& rhs)
|
||||||
|
{
|
||||||
|
TypeHolderStd::operator=(rhs);
|
||||||
|
constraintType = rhs.constraintType;
|
||||||
|
ddn = rhs.ddn;
|
||||||
|
defaultValue = rhs.defaultValue;
|
||||||
|
colPosition = rhs.colPosition;
|
||||||
|
compressionType = rhs.compressionType;
|
||||||
|
columnOID = rhs.columnOID;
|
||||||
|
autoincrement = rhs.autoincrement;
|
||||||
|
nextvalue = rhs.nextvalue;
|
||||||
|
charsetNumber = rhs.charsetNumber;
|
||||||
|
cs = rhs.cs;
|
||||||
|
|
||||||
|
return *this;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
CHARSET_INFO* CalpontSystemCatalog::ColType::getCharset()
|
CHARSET_INFO* CalpontSystemCatalog::ColType::getCharset()
|
||||||
{
|
{
|
||||||
if (!cs)
|
if (!cs)
|
||||||
|
@ -60,8 +60,7 @@ typedef execplan::CalpontSystemCatalog::ColType Type;
|
|||||||
class IDB_Decimal: public datatypes::VDecimal
|
class IDB_Decimal: public datatypes::VDecimal
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
using datatypes::VDecimal::VDecimal;
|
IDB_Decimal() = default;
|
||||||
|
|
||||||
IDB_Decimal(int64_t val, int8_t s, uint8_t p, const int128_t &val128 = 0) :
|
IDB_Decimal(int64_t val, int8_t s, uint8_t p, const int128_t &val128 = 0) :
|
||||||
VDecimal(val, s, p, val128) {}
|
VDecimal(val, s, p, val128) {}
|
||||||
|
|
||||||
|
@ -303,7 +303,7 @@ float RowEstimator::estimateRowReturnFactor(const BRM::EMEntry& emEntry,
|
|||||||
float factor = 1.0;
|
float factor = 1.0;
|
||||||
float tempFactor = 1.0;
|
float tempFactor = 1.0;
|
||||||
|
|
||||||
uint64_t adjustedMin, adjustedMax;
|
uint64_t adjustedMin = 0, adjustedMax = 0;
|
||||||
uint128_t adjustedBigMin, adjustedBigMax;
|
uint128_t adjustedBigMin, adjustedBigMax;
|
||||||
uint32_t distinctValuesEstimate;
|
uint32_t distinctValuesEstimate;
|
||||||
|
|
||||||
|
@ -1584,7 +1584,8 @@ bool TupleBPS::processSingleFilterString(int8_t BOP, int8_t colWidth, T val, con
|
|||||||
throw logic_error("invalid column width");
|
throw logic_error("invalid column width");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (colWidth < datatypes::MAXDECIMALWIDTH)
|
// Assumption is that colWidth > 0
|
||||||
|
if (static_cast<uint8_t>(colWidth) < datatypes::MAXDECIMALWIDTH)
|
||||||
thisPredicate = compareSingleValue(COP, (int64_t) val, val2);
|
thisPredicate = compareSingleValue(COP, (int64_t) val, val2);
|
||||||
else
|
else
|
||||||
thisPredicate = compareSingleValue(COP, (int128_t) val, bigVal2);
|
thisPredicate = compareSingleValue(COP, (int128_t) val, bigVal2);
|
||||||
|
1
debian/mariadb-plugin-columnstore.install
vendored
1
debian/mariadb-plugin-columnstore.install
vendored
@ -121,6 +121,7 @@ usr/lib/*/libwindowfunction.so
|
|||||||
usr/lib/*/libwriteengine.so
|
usr/lib/*/libwriteengine.so
|
||||||
usr/lib/*/libwriteengineclient.so
|
usr/lib/*/libwriteengineclient.so
|
||||||
usr/lib/*/libwriteengineredistribute.so
|
usr/lib/*/libwriteengineredistribute.so
|
||||||
|
usr/lib/*/libdatatypes.so
|
||||||
usr/lib/mysql/plugin/ha_columnstore.so
|
usr/lib/mysql/plugin/ha_columnstore.so
|
||||||
usr/lib/mysql/plugin/libregr_mysql.so
|
usr/lib/mysql/plugin/libregr_mysql.so
|
||||||
usr/lib/mysql/plugin/libudf_mysql.so
|
usr/lib/mysql/plugin/libudf_mysql.so
|
||||||
|
@ -18,25 +18,33 @@
|
|||||||
#define UTILS_COMMON_CHECKS_H
|
#define UTILS_COMMON_CHECKS_H
|
||||||
|
|
||||||
#include <type_traits>
|
#include <type_traits>
|
||||||
|
#include "mcs_int128.h"
|
||||||
|
|
||||||
namespace utils {
|
namespace utils {
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_unsigned<T>::value, bool>::type is_nonnegative(T)
|
typename std::enable_if<std::is_unsigned<T>::value ||
|
||||||
{ return true; };
|
datatypes::is_uint128_t<T>::value,
|
||||||
|
bool>::type
|
||||||
|
is_nonnegative(T) { return true; };
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_signed<T>::value, bool>::type is_nonnegative(T v)
|
typename std::enable_if<std::is_signed<T>::value ||
|
||||||
{ return v >= 0; };
|
datatypes::is_int128_t<T>::value,
|
||||||
|
bool>::type
|
||||||
|
is_nonnegative(T v) { return v >= 0; };
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_unsigned<T>::value, bool>::type is_negative(T)
|
typename std::enable_if<std::is_unsigned<T>::value ||
|
||||||
{ return false; };
|
datatypes::is_uint128_t<T>::value,
|
||||||
|
bool>::type
|
||||||
|
is_negative(T) { return false; };
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
typename std::enable_if<std::is_signed<T>::value, bool>::type is_negative(T v)
|
typename std::enable_if<std::is_signed<T>::value ||
|
||||||
{ return v < 0; };
|
datatypes::is_int128_t<T>::value,
|
||||||
|
bool>::type
|
||||||
|
is_negative(T v) { return v < 0; };
|
||||||
|
|
||||||
} // namespace utils
|
} // namespace utils
|
||||||
|
|
||||||
|
@ -383,7 +383,7 @@ uint64_t Func_cast_unsigned::getUintVal(Row& row,
|
|||||||
uint128_t tmpval = d.s128Value / scaleDivisor;
|
uint128_t tmpval = d.s128Value / scaleDivisor;
|
||||||
int128_t lefto = (d.s128Value - tmpval * scaleDivisor) / scaleDivisor2;
|
int128_t lefto = (d.s128Value - tmpval * scaleDivisor) / scaleDivisor2;
|
||||||
|
|
||||||
if (tmpval >= 0 && lefto > 4)
|
if (utils::is_nonnegative(tmpval) && lefto > 4)
|
||||||
tmpval++;
|
tmpval++;
|
||||||
|
|
||||||
if (tmpval > static_cast<int128_t>(UINT64_MAX))
|
if (tmpval > static_cast<int128_t>(UINT64_MAX))
|
||||||
@ -404,7 +404,9 @@ uint64_t Func_cast_unsigned::getUintVal(Row& row,
|
|||||||
int lefto = (d.value - value * pow(10.0, dscale)) / pow(10.0, dscale - 1);
|
int lefto = (d.value - value * pow(10.0, dscale)) / pow(10.0, dscale - 1);
|
||||||
|
|
||||||
if ( utils::is_nonnegative(value) && lefto > 4 )
|
if ( utils::is_nonnegative(value) && lefto > 4 )
|
||||||
|
{
|
||||||
value++;
|
value++;
|
||||||
|
}
|
||||||
|
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -86,10 +86,10 @@ string Func_elt::getStrVal(rowgroup::Row& row,
|
|||||||
int128_t tmpval = d.s128Value / scaleDivisor;
|
int128_t tmpval = d.s128Value / scaleDivisor;
|
||||||
int128_t lefto = (d.s128Value - tmpval * scaleDivisor) / scaleDivisor2;
|
int128_t lefto = (d.s128Value - tmpval * scaleDivisor) / scaleDivisor2;
|
||||||
|
|
||||||
if (utils::is_nonnegative(tmpval) >= 0 && lefto > 4)
|
if (utils::is_nonnegative(tmpval) && lefto > 4)
|
||||||
tmpval++;
|
tmpval++;
|
||||||
|
|
||||||
if (utils::is_negative(tmpval) < 0 && lefto < -4)
|
if (utils::is_negative(tmpval) && lefto < -4)
|
||||||
tmpval--;
|
tmpval--;
|
||||||
|
|
||||||
number = datatypes::Decimal::getInt64FromWideDecimal(tmpval);
|
number = datatypes::Decimal::getInt64FromWideDecimal(tmpval);
|
||||||
|
Reference in New Issue
Block a user