diff --git a/datatypes/mcs_datatype.h b/datatypes/mcs_datatype.h index 358d69c04..abd8a21b9 100644 --- a/datatypes/mcs_datatype.h +++ b/datatypes/mcs_datatype.h @@ -32,10 +32,6 @@ typedef int32_t mcs_sint32_t; #endif -using int128_t = __int128; -using uint128_t = unsigned __int128; - - // Because including my_sys.h in a Columnstore header causes too many conflicts struct charset_info_st; typedef const struct charset_info_st CHARSET_INFO; diff --git a/datatypes/mcs_decimal.h b/datatypes/mcs_decimal.h index dcef8b947..b2fd8a225 100644 --- a/datatypes/mcs_decimal.h +++ b/datatypes/mcs_decimal.h @@ -21,11 +21,10 @@ #include #include #include +#include "mcs_basic_types.h" #include "exceptclasses.h" #include "widedecimalutils.h" -using int128_t = __int128; -using uint128_t = unsigned __int128; namespace datatypes { diff --git a/dbcon/execplan/calpontsystemcatalog.h b/dbcon/execplan/calpontsystemcatalog.h index 29113afc8..b40ca48aa 100644 --- a/dbcon/execplan/calpontsystemcatalog.h +++ b/dbcon/execplan/calpontsystemcatalog.h @@ -39,6 +39,7 @@ #include #include +#include "mcs_basic_types.h" #include "../../writeengine/shared/we_typeext.h" #include "columnresult.h" #include "bytestream.h" diff --git a/dbcon/joblist/batchprimitiveprocessor-jl.cpp b/dbcon/joblist/batchprimitiveprocessor-jl.cpp index 929252d56..aff8f4e8b 100644 --- a/dbcon/joblist/batchprimitiveprocessor-jl.cpp +++ b/dbcon/joblist/batchprimitiveprocessor-jl.cpp @@ -731,12 +731,12 @@ void BatchPrimitiveProcessorJL::deserializeAggregateResult(ByteStream* in, } void BatchPrimitiveProcessorJL::getRowGroupData(ByteStream& in, vector* out, - bool* validCPData, uint64_t* lbid, __int128* min, __int128* max, + bool* validCPData, uint64_t* lbid, int128_t* min, int128_t* max, uint32_t* cachedIO, uint32_t* physIO, uint32_t* touchedBlocks, bool* countThis, uint32_t threadID, bool* hasWideColumn, const execplan::CalpontSystemCatalog::ColType& colType) const { uint64_t tmp64; - unsigned __int128 tmp128; + uint128_t tmp128; uint8_t tmp8; RGData rgData; uint32_t rowCount; diff --git a/dbcon/joblist/batchprimitiveprocessor-jl.h b/dbcon/joblist/batchprimitiveprocessor-jl.h index 0a8f1f841..fc535664d 100644 --- a/dbcon/joblist/batchprimitiveprocessor-jl.h +++ b/dbcon/joblist/batchprimitiveprocessor-jl.h @@ -37,6 +37,7 @@ #include #include +#include "mcs_basic_types.h" #include "primitivemsg.h" #include "serializeable.h" #include "primitivestep.h" @@ -168,7 +169,7 @@ public: void deserializeAggregateResults(messageqcpp::ByteStream* in, std::vector* out) const; void getRowGroupData(messageqcpp::ByteStream& in, std::vector* out, - bool* validCPData, uint64_t* lbid, __int128* min, __int128* max, + bool* validCPData, uint64_t* lbid, int128_t* min, int128_t* max, uint32_t* cachedIO, uint32_t* physIO, uint32_t* touchedBlocks, bool* countThis, uint32_t threadID, bool* hasBinaryColumn, const execplan::CalpontSystemCatalog::ColType& colType) const; void deserializeAggregateResult(messageqcpp::ByteStream* in, diff --git a/dbcon/joblist/lbidlist.cpp b/dbcon/joblist/lbidlist.cpp index 4f2affc89..36725dc8e 100644 --- a/dbcon/joblist/lbidlist.cpp +++ b/dbcon/joblist/lbidlist.cpp @@ -236,7 +236,7 @@ bool LBIDList::GetMinMax(T& min, T& max, int64_t& seq, int64_t lbid, if (isUnsigned(colDataType)) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { mmp->bigMax = 0; mmp->bigMin = -1; @@ -249,7 +249,7 @@ bool LBIDList::GetMinMax(T& min, T& max, int64_t& seq, int64_t lbid, } else { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { utils::int128Min(mmp->bigMax); utils::int128Max(mmp->bigMin); @@ -296,7 +296,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq, if (isUnsigned(colDataType)) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { mmp->bigMax = 0; mmp->bigMin = -1; @@ -309,7 +309,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq, } else { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { utils::int128Min(mmp->bigMax); utils::int128Max(mmp->bigMin); @@ -327,7 +327,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq, return false; } - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { *min = entry.partition.cprange.bigLoVal; *max = entry.partition.cprange.bigHiVal; @@ -356,7 +356,7 @@ int LBIDList::getMinMaxFromEntries(T& min, T& max, int32_t& seq, if (lbid >= EMEntries[i].range.start && lbid <= lastLBID) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { min = EMEntries[i].partition.cprange.bigLoVal; max = EMEntries[i].partition.cprange.bigHiVal; @@ -426,12 +426,12 @@ void LBIDList::UpdateMinMax(T min, T max, int64_t lbid, CalpontSystemCatalog::Co } else if (datatypes::isUnsigned(type)) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { - if (static_cast(min) < static_cast(mmp->bigMin)) + if (static_cast(min) < static_cast(mmp->bigMin)) mmp->bigMin = min; - if (static_cast(max) > static_cast(mmp->bigMax)) + if (static_cast(max) > static_cast(mmp->bigMax)) mmp->bigMax = max; } else @@ -445,7 +445,7 @@ void LBIDList::UpdateMinMax(T min, T max, int64_t lbid, CalpontSystemCatalog::Co } else { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { if (min < mmp->bigMin) mmp->bigMin = min; @@ -686,7 +686,7 @@ bool LBIDList::checkSingleValue(T min, T max, T value, if (isCharType(type)) { // MCOL-641 LBIDList::CasualPartitionDataType() returns false if - // width > 8 for a character type, so T cannot be __int128 here + // width > 8 for a character type, so T cannot be int128_t here uint64_t mmin = order_swap(min); uint64_t mmax = order_swap(max); uint64_t vvalue = order_swap(value); @@ -694,10 +694,10 @@ bool LBIDList::checkSingleValue(T min, T max, T value, } else if (isUnsigned(type)) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { - return (static_cast(value) >= static_cast(min) && - static_cast(value) <= static_cast(max)); + return (static_cast(value) >= static_cast(min) && + static_cast(value) <= static_cast(max)); } else { @@ -718,7 +718,7 @@ bool LBIDList::checkRangeOverlap(T min, T max, T tmin, T tmax, if (isCharType(type)) { // MCOL-641 LBIDList::CasualPartitionDataType() returns false if - // width > 8 for a character type, so T cannot be __int128 here + // width > 8 for a character type, so T cannot be int128_t here uint64_t min2 = order_swap(min); uint64_t max2 = order_swap(max); uint64_t tmin2 = order_swap(tmin); @@ -727,10 +727,10 @@ bool LBIDList::checkRangeOverlap(T min, T max, T tmin, T tmax, } else if (isUnsigned(type)) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { - return (static_cast(tmin) <= static_cast(max) && - static_cast(tmax) >= static_cast(min)); + return (static_cast(tmin) <= static_cast(max) && + static_cast(tmax) >= static_cast(min)); } else { @@ -755,7 +755,7 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange, const char* MsgDataPtr = (const char*) bs->buf(); bool scan = true; int64_t value = 0; - __int128 bigValue = 0; + int128_t bigValue = 0; bool bIsUnsigned = datatypes::isUnsigned(ct.colDataType); bool bIsChar = datatypes::isCharType(ct.colDataType); @@ -891,7 +891,7 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange, } else { - scan = compareVal(static_cast(cpRange.bigLoVal), static_cast(cpRange.bigHiVal), static_cast(bigValue), op, lcf); + scan = compareVal(static_cast(cpRange.bigLoVal), static_cast(cpRange.bigHiVal), static_cast(bigValue), op, lcf); } } else @@ -959,7 +959,7 @@ void LBIDList::copyLbidList(const LBIDList& rhs) } template -bool LBIDList::GetMinMax<__int128>(__int128& min, __int128& max, int64_t& seq, int64_t lbid, +bool LBIDList::GetMinMax(int128_t& min, int128_t& max, int64_t& seq, int64_t lbid, const std::vector* pEMEntries, execplan::CalpontSystemCatalog::ColDataType colDataType); template @@ -968,7 +968,7 @@ bool LBIDList::GetMinMax(int64_t& min, int64_t& max, int64_t& seq, int6 execplan::CalpontSystemCatalog::ColDataType colDataType); template -bool LBIDList::GetMinMax<__int128>(__int128* min, __int128* max, int64_t* seq, +bool LBIDList::GetMinMax(int128_t* min, int128_t* max, int64_t* seq, int64_t lbid, const tr1::unordered_map& entries, execplan::CalpontSystemCatalog::ColDataType colDataType); @@ -978,7 +978,7 @@ bool LBIDList::GetMinMax(int64_t* min, int64_t* max, int64_t* seq, execplan::CalpontSystemCatalog::ColDataType colDataType); template -void LBIDList::UpdateMinMax<__int128>(__int128 min, __int128 max, int64_t lbid, +void LBIDList::UpdateMinMax(int128_t min, int128_t max, int64_t lbid, execplan::CalpontSystemCatalog::ColDataType type, bool validData = true); template @@ -986,7 +986,7 @@ void LBIDList::UpdateMinMax(int64_t min, int64_t max, int64_t lbid, execplan::CalpontSystemCatalog::ColDataType type, bool validData = true); template -bool LBIDList::checkSingleValue<__int128>(__int128 min, __int128 max, __int128 value, +bool LBIDList::checkSingleValue(int128_t min, int128_t max, int128_t value, execplan::CalpontSystemCatalog::ColDataType type); template @@ -994,7 +994,7 @@ bool LBIDList::checkSingleValue(int64_t min, int64_t max, int64_t value execplan::CalpontSystemCatalog::ColDataType type); template -bool LBIDList::checkRangeOverlap<__int128>(__int128 min, __int128 max, __int128 tmin, __int128 tmax, +bool LBIDList::checkRangeOverlap(int128_t min, int128_t max, int128_t tmin, int128_t tmax, execplan::CalpontSystemCatalog::ColDataType type); template diff --git a/dbcon/joblist/lbidlist.h b/dbcon/joblist/lbidlist.h index 934f42924..0f1925332 100644 --- a/dbcon/joblist/lbidlist.h +++ b/dbcon/joblist/lbidlist.h @@ -55,12 +55,12 @@ struct MinMaxPartition uint32_t blksScanned; union { - __int128 bigMin; + int128_t bigMin; int64_t min; }; union { - __int128 bigMax; + int128_t bigMax; int64_t max; }; }; diff --git a/dbcon/joblist/primitivestep.h b/dbcon/joblist/primitivestep.h index e57443ff3..d594685b1 100644 --- a/dbcon/joblist/primitivestep.h +++ b/dbcon/joblist/primitivestep.h @@ -46,6 +46,7 @@ #include #include +#include "mcs_basic_types.h" #include "calpontsystemcatalog.h" #include "calpontselectexecutionplan.h" #include "brm.h" @@ -1327,7 +1328,7 @@ public: * Note that it is an adder not a setter. For an extent to be scanned, all calls * must have a non-empty intersection. */ - void addCPPredicates(uint32_t OID, const std::vector<__int128>& vals, bool isRange, + void addCPPredicates(uint32_t OID, const std::vector& vals, bool isRange, bool isSmallSideWideDecimal); /* semijoin adds */ diff --git a/dbcon/joblist/tuple-bps.cpp b/dbcon/joblist/tuple-bps.cpp index 44162ba6e..ceee3e8f0 100644 --- a/dbcon/joblist/tuple-bps.cpp +++ b/dbcon/joblist/tuple-bps.cpp @@ -927,7 +927,7 @@ void TupleBPS::prepCasualPartitioning() { uint32_t i; int64_t min, max, seq; - __int128 bigMin, bigMax; + int128_t bigMin, bigMax; boost::mutex::scoped_lock lk(cpMutex); for (i = 0; i < scannedExtents.size(); i++) @@ -1889,15 +1889,15 @@ abort: struct _CPInfo { _CPInfo(int64_t MIN, int64_t MAX, uint64_t l, bool val) : min(MIN), max(MAX), LBID(l), valid(val) { }; - _CPInfo(__int128 BIGMIN, __int128 BIGMAX, uint64_t l, bool val) : bigMin(BIGMIN), bigMax(BIGMAX), LBID(l), valid(val) { }; + _CPInfo(int128_t BIGMIN, int128_t BIGMAX, uint64_t l, bool val) : bigMin(BIGMIN), bigMax(BIGMAX), LBID(l), valid(val) { }; union { - __int128 bigMin; + int128_t bigMin; int64_t min; }; union { - __int128 bigMax; + int128_t bigMax; int64_t max; }; uint64_t LBID; @@ -1918,8 +1918,8 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID) bool validCPData; bool hasBinaryColumn; - __int128 min; - __int128 max; + int128_t min; + int128_t max; uint64_t lbid; vector<_CPInfo> cpv; uint32_t cachedIO; @@ -3212,7 +3212,7 @@ void TupleBPS::setJoinFERG(const RowGroup& rg) fBPP->setJoinFERG(rg); } -void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool isRange, +void TupleBPS::addCPPredicates(uint32_t OID, const vector& vals, bool isRange, bool isSmallSideWideDecimal) { @@ -3221,7 +3221,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool uint32_t i, j, k; int64_t min, max, seq; - __int128 bigMin, bigMax; + int128_t bigMin, bigMax; bool isValid, intersection; vector colCmdVec = fBPP->getFilterSteps(); ColumnCommandJL* cmd; @@ -3292,7 +3292,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool } else { - runtimeCPFlags[j] = ll.checkRangeOverlap((__int128) min, (__int128) max, vals[0], vals[1], + runtimeCPFlags[j] = ll.checkRangeOverlap((int128_t) min, (int128_t) max, vals[0], vals[1], colType.colDataType) && runtimeCPFlags[j]; } } @@ -3310,7 +3310,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool else { intersection = intersection || - ll.checkSingleValue((__int128) min, (__int128) max, vals[k], colType.colDataType); + ll.checkSingleValue((int128_t) min, (int128_t) max, vals[k], colType.colDataType); } } diff --git a/dbcon/mysql/ha_mcs_impl.cpp b/dbcon/mysql/ha_mcs_impl.cpp index e94f19595..d1868f52d 100644 --- a/dbcon/mysql/ha_mcs_impl.cpp +++ b/dbcon/mysql/ha_mcs_impl.cpp @@ -56,6 +56,7 @@ using namespace std; #include #include +#include "mcs_basic_types.h" #include "idb_mysql.h" #define NEED_CALPONT_INTERFACE @@ -145,7 +146,6 @@ namespace cal_impl_if extern bool nonConstFunc(Item_func* ifp); } -using int128_t = __int128; namespace { diff --git a/tests/arithmeticoperator-tests.cpp b/tests/arithmeticoperator-tests.cpp index dc192fbd1..5f883eb9d 100644 --- a/tests/arithmeticoperator-tests.cpp +++ b/tests/arithmeticoperator-tests.cpp @@ -16,9 +16,8 @@ MA 02110-1301, USA. */ #include // googletest header file +#include "mcs_basic_types.h" -using int128_t = __int128; -using uint128_t = unsigned __int128; //using CSCDataType = execplan::CalpontSystemCatalog::ColDataType; TEST(SimpleCheck, check1) diff --git a/tests/comparators-tests.cpp b/tests/comparators-tests.cpp index 4d6f8aab2..4b754dacf 100644 --- a/tests/comparators-tests.cpp +++ b/tests/comparators-tests.cpp @@ -42,7 +42,6 @@ #define DEBUG #define MEMORY_LIMIT 14983602176 -using int128_t = __int128; using namespace std; using namespace joblist; using namespace messageqcpp; diff --git a/tests/rowgroup-tests.cpp b/tests/rowgroup-tests.cpp index 7232d4898..cc031606b 100644 --- a/tests/rowgroup-tests.cpp +++ b/tests/rowgroup-tests.cpp @@ -26,8 +26,6 @@ #define WIDE_DEC_PRECISION 38U #define INITIAL_ROW_OFFSET 2 -using int128_t = __int128; -using uint128_t = unsigned __int128; using CSCDataType = execplan::CalpontSystemCatalog::ColDataType; class RowDecimalTest : public ::testing::Test diff --git a/utils/common/any.hpp b/utils/common/any.hpp index 7ae5d553e..f39d5cec2 100755 --- a/utils/common/any.hpp +++ b/utils/common/any.hpp @@ -12,6 +12,7 @@ #include #include #include +#include "mcs_basic_types.h" namespace static_any { @@ -127,8 +128,8 @@ namespace anyimpl #define BIG_POLICY(TYPE) template<> struct \ choose_policy { typedef big_any_policy type; }; - BIG_POLICY(__int128); - BIG_POLICY(unsigned __int128); + BIG_POLICY(int128_t); + BIG_POLICY(uint128_t); /// Specializations for small types. #define SMALL_POLICY(TYPE) template<> struct \ diff --git a/utils/common/hasher.h b/utils/common/hasher.h index 08b6b6ac1..1633986a2 100644 --- a/utils/common/hasher.h +++ b/utils/common/hasher.h @@ -29,9 +29,7 @@ #include #include - -using int128_t = __int128; -using uint128_t = unsigned __int128; +#include "mcs_basic_types.h" namespace utils { diff --git a/utils/common/mcs_basic_types.h b/utils/common/mcs_basic_types.h new file mode 100644 index 000000000..131fcdc68 --- /dev/null +++ b/utils/common/mcs_basic_types.h @@ -0,0 +1,28 @@ +/* + Copyright (C) 2020 MariaDB Corporation + + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; version 2 of + the License. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + MA 02110-1301, USA. +*/ +#ifndef MCS_BASIC_TYPES_H_INCLUDED +#define MCS_BASIC_TYPES_H_INCLUDED + + +using int128_t = __int128; +using uint128_t = unsigned __int128; + + +#endif // MCS_BASIC_TYPES_H_INCLUDED +// vim:ts=2 sw=2: diff --git a/utils/common/widedecimalutils.h b/utils/common/widedecimalutils.h index b6f1ad5e9..7e931d7fe 100644 --- a/utils/common/widedecimalutils.h +++ b/utils/common/widedecimalutils.h @@ -19,9 +19,7 @@ #define WIDE_DECIMAL_UTILS_H #include - -using int128_t = __int128; -using uint128_t = unsigned __int128; +#include "mcs_basic_types.h" namespace utils { diff --git a/utils/dataconvert/dataconvert.h b/utils/dataconvert/dataconvert.h index 4b1dfa96b..0b918fb8b 100644 --- a/utils/dataconvert/dataconvert.h +++ b/utils/dataconvert/dataconvert.h @@ -160,10 +160,6 @@ const int32_t MIN_TIMESTAMP_VALUE = 0; namespace dataconvert { -// WIP MCOL-641 -using int128_t = __int128; -using uint128_t = unsigned __int128; - enum CalpontDateTimeFormat { CALPONTDATE_ENUM = 1, // date format is: "YYYY-MM-DD" @@ -1474,7 +1470,7 @@ inline bool greaterThan128(int128_t a, int128_t b) return a > b; } -// Naive __int128 version of strtoll +// Naive int128_t version of strtoll inline int128_t strtoll128(const char* data, bool& saturate, char** ep) { int128_t res = 0; diff --git a/utils/messageqcpp/bytestream.h b/utils/messageqcpp/bytestream.h index ade220d76..970ff9423 100644 --- a/utils/messageqcpp/bytestream.h +++ b/utils/messageqcpp/bytestream.h @@ -33,6 +33,7 @@ #include #include +#include "mcs_basic_types.h" #include "exceptclasses.h" #include "serializeable.h" #include "any.hpp" @@ -45,8 +46,6 @@ class ByteStreamTestSuite; #define EXPORT #endif -using int128_t = __int128; -using uint128_t = unsigned __int128; namespace messageqcpp { diff --git a/utils/rowgroup/rowaggregation.cpp b/utils/rowgroup/rowaggregation.cpp index 643b934b5..e9199f8fd 100755 --- a/utils/rowgroup/rowaggregation.cpp +++ b/utils/rowgroup/rowaggregation.cpp @@ -238,13 +238,13 @@ const static_any::any& RowAggregation::shortTypeId((short)1); const static_any::any& RowAggregation::intTypeId((int)1); const static_any::any& RowAggregation::longTypeId((long)1); const static_any::any& RowAggregation::llTypeId((long long)1); -const static_any::any& RowAggregation::int128TypeId((__int128)1); +const static_any::any& RowAggregation::int128TypeId((int128_t)1); const static_any::any& RowAggregation::ucharTypeId((unsigned char)1); const static_any::any& RowAggregation::ushortTypeId((unsigned short)1); const static_any::any& RowAggregation::uintTypeId((unsigned int)1); const static_any::any& RowAggregation::ulongTypeId((unsigned long)1); const static_any::any& RowAggregation::ullTypeId((unsigned long long)1); -const static_any::any& RowAggregation::uint128TypeId((unsigned __int128)1); +const static_any::any& RowAggregation::uint128TypeId((uint128_t)1); const static_any::any& RowAggregation::floatTypeId((float)1); const static_any::any& RowAggregation::doubleTypeId((double)1); const static_any::any& RowAggregation::longdoubleTypeId((long double)1); diff --git a/utils/rowgroup/rowgroup-tests.cpp b/utils/rowgroup/rowgroup-tests.cpp index 8fbbe22fc..3ebfb6c0b 100644 --- a/utils/rowgroup/rowgroup-tests.cpp +++ b/utils/rowgroup/rowgroup-tests.cpp @@ -26,8 +26,6 @@ #define WIDE_DEC_PRECISION 38U #define INITIAL_ROW_OFFSET 2 -using int128_t = __int128; -using uint128_t = unsigned __int128; using CSCDataType = execplan::CalpontSystemCatalog::ColDataType; class RowDecimalTest : public ::testing::Test { diff --git a/utils/rowgroup/rowgroup.h b/utils/rowgroup/rowgroup.h index 94f72776a..2d1ba045c 100644 --- a/utils/rowgroup/rowgroup.h +++ b/utils/rowgroup/rowgroup.h @@ -65,9 +65,6 @@ typedef const struct charset_info_st CHARSET_INFO; // Workaround for my_global.h #define of isnan(X) causing a std::std namespace -using int128_t = __int128; -using uint128_t = unsigned __int128; - namespace rowgroup { diff --git a/utils/udfsdk/mcsv1_udaf.cpp b/utils/udfsdk/mcsv1_udaf.cpp index dea99c125..cd08e3573 100755 --- a/utils/udfsdk/mcsv1_udaf.cpp +++ b/utils/udfsdk/mcsv1_udaf.cpp @@ -18,6 +18,7 @@ #include #include #include +#include "mcs_basic_types.h" #include "mcsv1_udaf.h" #include "bytestream.h" #include "objectreader.h" @@ -278,13 +279,13 @@ const static_any::any& mcsv1_UDAF::shortTypeId((short)1); const static_any::any& mcsv1_UDAF::intTypeId((int)1); const static_any::any& mcsv1_UDAF::longTypeId((long)1); const static_any::any& mcsv1_UDAF::llTypeId((long long)1); -const static_any::any& mcsv1_UDAF::int128TypeId((__int128)1); +const static_any::any& mcsv1_UDAF::int128TypeId((int128_t)1); const static_any::any& mcsv1_UDAF::ucharTypeId((unsigned char)1); const static_any::any& mcsv1_UDAF::ushortTypeId((unsigned short)1); const static_any::any& mcsv1_UDAF::uintTypeId((unsigned int)1); const static_any::any& mcsv1_UDAF::ulongTypeId((unsigned long)1); const static_any::any& mcsv1_UDAF::ullTypeId((unsigned long long)1); -const static_any::any& mcsv1_UDAF::uint128TypeId((unsigned __int128)1); +const static_any::any& mcsv1_UDAF::uint128TypeId((uint128_t)1); const static_any::any& mcsv1_UDAF::floatTypeId((float)1); const static_any::any& mcsv1_UDAF::doubleTypeId((double)1); const static_any::any& mcsv1_UDAF::strTypeId(typeStr); diff --git a/utils/windowfunction/idborderby.cpp b/utils/windowfunction/idborderby.cpp index 1028d3e1d..69344c43e 100644 --- a/utils/windowfunction/idborderby.cpp +++ b/utils/windowfunction/idborderby.cpp @@ -48,9 +48,6 @@ using namespace rowgroup; #include "joblisttypes.h" #include "mcs_decimal.h" - -using int128_t = __int128; - #include "collation.h" // See agg_arg_charsets in sql_type.h to see conversion rules for diff --git a/utils/windowfunction/wf_udaf.cpp b/utils/windowfunction/wf_udaf.cpp index 75075b778..62d4a2714 100644 --- a/utils/windowfunction/wf_udaf.cpp +++ b/utils/windowfunction/wf_udaf.cpp @@ -544,13 +544,13 @@ void WF_udaf::SetUDAFValue(static_any::any& valOut, int64_t colOut, static const static_any::any& intTypeId = (int)1; static const static_any::any& longTypeId = (long)1; static const static_any::any& llTypeId = (long long)1; - static const static_any::any& int128TypeId = (__int128)1; + static const static_any::any& int128TypeId = (int128_t)1; static const static_any::any& ucharTypeId = (unsigned char)1; static const static_any::any& ushortTypeId = (unsigned short)1; static const static_any::any& uintTypeId = (unsigned int)1; static const static_any::any& ulongTypeId = (unsigned long)1; static const static_any::any& ullTypeId = (unsigned long long)1; - static const static_any::any& uint128TypeId = (unsigned __int128)1; + static const static_any::any& uint128TypeId = (uint128_t)1; static const static_any::any& floatTypeId = (float)1; static const static_any::any& doubleTypeId = (double)1; static const std::string typeStr(""); diff --git a/versioning/BRM/brmtypes.h b/versioning/BRM/brmtypes.h index 373b1a2eb..623720263 100644 --- a/versioning/BRM/brmtypes.h +++ b/versioning/BRM/brmtypes.h @@ -31,6 +31,7 @@ #include #include #include +#include "mcs_basic_types.h" #include "logicalpartition.h" #ifndef _MSC_VER @@ -153,12 +154,12 @@ struct CPInfo int32_t seqNum; union { - __int128 bigMax; + int128_t bigMax; int64_t max_; }; union { - __int128 bigMin; + int128_t bigMin; int64_t min_; }; bool isBinaryColumn; @@ -173,12 +174,12 @@ struct CPMaxMin int32_t seqNum; union { - __int128 bigMax; + int128_t bigMax; int64_t max_; }; union { - __int128 bigMin; + int128_t bigMin; int64_t min_; }; bool isBinaryColumn; @@ -198,12 +199,12 @@ struct CPInfoMerge bool newExtent; // is this to be treated as a new extent union { - __int128 bigMax; + int128_t bigMax; int64_t max_; }; union { - __int128 bigMin; + int128_t bigMin; int64_t min_; }; }; @@ -221,12 +222,12 @@ struct CPMaxMinMerge bool newExtent; union { - __int128 bigMax; + int128_t bigMax; int64_t max_; }; union { - __int128 bigMin; + int128_t bigMin; int64_t min_; }; }; diff --git a/versioning/BRM/dbrm.cpp b/versioning/BRM/dbrm.cpp index ad0f96c9f..7c8b3c860 100644 --- a/versioning/BRM/dbrm.cpp +++ b/versioning/BRM/dbrm.cpp @@ -560,7 +560,7 @@ int DBRM::setExtentsMaxMin(const CPInfoList_t& cpInfos) DBRM_THROW { if (it->isBinaryColumn) { - command << (uint8_t)1 << (uint64_t)it->firstLbid << (unsigned __int128)it->bigMax << (unsigned __int128)it->bigMin << (uint32_t)it->seqNum; + command << (uint8_t)1 << (uint64_t)it->firstLbid << (uint128_t)it->bigMax << (uint128_t)it->bigMin << (uint32_t)it->seqNum; } else { @@ -4583,7 +4583,7 @@ void DBRM::invalidateUncommittedExtentLBIDs(execplan::CalpontSystemCatalog::SCN } template -int DBRM::getExtentMaxMin<__int128>(const LBID_t lbid, __int128& max, __int128& min, int32_t& seqNum) throw(); +int DBRM::getExtentMaxMin(const LBID_t lbid, int128_t& max, int128_t& min, int32_t& seqNum) throw(); template int DBRM::getExtentMaxMin(const LBID_t lbid, int64_t& max, int64_t& min, int32_t& seqNum) throw(); diff --git a/versioning/BRM/extentmap.cpp b/versioning/BRM/extentmap.cpp index 20fde35c9..bb48844b8 100644 --- a/versioning/BRM/extentmap.cpp +++ b/versioning/BRM/extentmap.cpp @@ -132,7 +132,7 @@ EMCasualPartition_struct::EMCasualPartition_struct(const int64_t lo, const int64 isValid = CP_INVALID; } -EMCasualPartition_struct::EMCasualPartition_struct(const __int128 bigLo, const __int128 bigHi, const int32_t seqNum) +EMCasualPartition_struct::EMCasualPartition_struct(const int128_t bigLo, const int128_t bigHi, const int32_t seqNum) { bigLoVal = bigLo; bigHiVal = bigHi; @@ -890,15 +890,15 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock) } else { - if (static_cast(it->second.bigMin) < - static_cast(fExtentMap[i].partition.cprange.bigLoVal)) + if (static_cast(it->second.bigMin) < + static_cast(fExtentMap[i].partition.cprange.bigLoVal)) { fExtentMap[i].partition.cprange.bigLoVal = it->second.bigMin; } - if (static_cast(it->second.bigMax) > - static_cast(fExtentMap[i].partition.cprange.bigHiVal)) + if (static_cast(it->second.bigMax) > + static_cast(fExtentMap[i].partition.cprange.bigHiVal)) { fExtentMap[i].partition.cprange.bigHiVal = it->second.bigMax; @@ -1033,7 +1033,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst { if (isUnsigned(type)) { - if (typeid(T) != typeid(__int128)) + if (typeid(T) != typeid(int128_t)) { if ( (static_cast(min) >= (numeric_limits::max() - 1)) || (static_cast(max) >= (numeric_limits::max() - 1)) ) @@ -1043,11 +1043,11 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst } else { - unsigned __int128 temp; + uint128_t temp; utils::uint128Max(temp); - if ( (static_cast(min) >= (temp - 1)) || - (static_cast(max) >= (temp - 1)) ) + if ( (static_cast(min) >= (temp - 1)) || + (static_cast(max) >= (temp - 1)) ) { return false; } @@ -1055,7 +1055,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst } else { - if (typeid(T) != typeid(__int128)) + if (typeid(T) != typeid(int128_t)) { if ( (min <= (numeric_limits::min() + 1)) || (max <= (numeric_limits::min() + 1)) ) @@ -1065,7 +1065,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst } else { - __int128 temp; + int128_t temp; utils::int128Min(temp); if ( (min <= (temp + 1)) || @@ -1105,9 +1105,9 @@ int ExtentMap::getMaxMin(const LBID_t lbid, } #endif - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { - __int128 tmpMax, tmpMin; + int128_t tmpMax, tmpMin; utils::int128Min(tmpMax); utils::int128Max(tmpMin); max = tmpMax; @@ -1143,7 +1143,7 @@ int ExtentMap::getMaxMin(const LBID_t lbid, if (lbid >= fExtentMap[i].range.start && lbid <= lastBlock) { - if (typeid(T) == typeid(__int128)) + if (typeid(T) == typeid(int128_t)) { max = fExtentMap[i].partition.cprange.bigHiVal; min = fExtentMap[i].partition.cprange.bigLoVal; @@ -6059,7 +6059,7 @@ void ExtentMap::dumpTo(ostream& os) */ template -int ExtentMap::getMaxMin<__int128>(const LBID_t lbidRange, __int128& max, __int128& min, int32_t& seqNum); +int ExtentMap::getMaxMin(const LBID_t lbidRange, int128_t& max, int128_t& min, int32_t& seqNum); template int ExtentMap::getMaxMin(const LBID_t lbidRange, int64_t& max, int64_t& min, int32_t& seqNum); diff --git a/versioning/BRM/extentmap.h b/versioning/BRM/extentmap.h index 7a5425935..8f16c3cee 100644 --- a/versioning/BRM/extentmap.h +++ b/versioning/BRM/extentmap.h @@ -137,17 +137,17 @@ struct EMCasualPartition_struct char isValid; //CP_INVALID - No min/max and no DML in progress. CP_UPDATING - Update in progress. CP_VALID- min/max is valid union { - __int128 bigLoVal; // These need to be reinterpreted as unsigned for uint64_t/uint128_t column types. + int128_t bigLoVal; // These need to be reinterpreted as unsigned for uint64_t/uint128_t column types. int64_t loVal; }; union { - __int128 bigHiVal; + int128_t bigHiVal; int64_t hiVal; }; EXPORT EMCasualPartition_struct(); EXPORT EMCasualPartition_struct(const int64_t lo, const int64_t hi, const int32_t seqNum); - EXPORT EMCasualPartition_struct(const __int128 bigLo, const __int128 bigHi, const int32_t seqNum); + EXPORT EMCasualPartition_struct(const int128_t bigLo, const int128_t bigHi, const int32_t seqNum); EXPORT EMCasualPartition_struct(const EMCasualPartition_struct& em); EXPORT EMCasualPartition_struct& operator= (const EMCasualPartition_struct& em); }; diff --git a/versioning/BRM/slavecomm.cpp b/versioning/BRM/slavecomm.cpp index 56b9d5d49..f63ffcadf 100644 --- a/versioning/BRM/slavecomm.cpp +++ b/versioning/BRM/slavecomm.cpp @@ -1330,7 +1330,7 @@ void SlaveComm::do_setExtentsMaxMin(ByteStream& msg) uint64_t tmp64; uint32_t tmp32; uint8_t tmp8; - unsigned __int128 tmp128; + uint128_t tmp128; int err; ByteStream reply; int32_t updateCount; diff --git a/writeengine/bulk/we_bulkloadbuffer.cpp b/writeengine/bulk/we_bulkloadbuffer.cpp index 250356156..e0fadf1f8 100644 --- a/writeengine/bulk/we_bulkloadbuffer.cpp +++ b/writeengine/bulk/we_bulkloadbuffer.cpp @@ -302,7 +302,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength, int32_t iDate; char charTmpBuf[MAX_COLUMN_BOUNDARY + 1] = {0}; long long llVal = 0, llDate = 0; - __int128 bigllVal = 0; + int128_t bigllVal = 0; uint64_t tmp64; uint32_t tmp32; uint8_t ubiVal; diff --git a/writeengine/bulk/we_bulkloadbuffer.h b/writeengine/bulk/we_bulkloadbuffer.h index ffccc2aeb..e953c1b82 100644 --- a/writeengine/bulk/we_bulkloadbuffer.h +++ b/writeengine/bulk/we_bulkloadbuffer.h @@ -45,12 +45,12 @@ public: int64_t satCount; union { - __int128 bigMinBufferVal; + int128_t bigMinBufferVal; int64_t minBufferVal_; }; union { - __int128 bigMaxBufferVal; + int128_t bigMaxBufferVal; int64_t maxBufferVal_; }; BLBufferStats(ColDataType colDataType) : satCount(0) diff --git a/writeengine/bulk/we_colextinf.cpp b/writeengine/bulk/we_colextinf.cpp index a4116df9b..c65158292 100644 --- a/writeengine/bulk/we_colextinf.cpp +++ b/writeengine/bulk/we_colextinf.cpp @@ -92,7 +92,7 @@ void ColExtInf::addOrUpdateEntryTemplate( RID lastInputRow, // If all rows had null value for this column, then minVal will be // MAX_INT and maxVal will be MIN_INT (see getCPInfoForBRM()). - __int128 bigMinValInit; + int128_t bigMinValInit; utils::int128Max(bigMinValInit); if ((iter->second.fMinVal == LLONG_MIN && width <= 8) || (iter->second.fbigMinVal == bigMinValInit && width > 8)) // init the range @@ -124,12 +124,12 @@ void ColExtInf::addOrUpdateEntryTemplate( RID lastInputRow, } else { - if (static_cast(minVal) - < static_cast(iter->second.fbigMinVal)) + if (static_cast(minVal) + < static_cast(iter->second.fbigMinVal)) iter->second.fbigMinVal = minVal; - if (static_cast(maxVal) - > static_cast(iter->second.fbigMaxVal)) + if (static_cast(maxVal) + > static_cast(iter->second.fbigMaxVal)) iter->second.fbigMaxVal = maxVal; } } @@ -214,8 +214,8 @@ void ColExtInf::getCPInfoForBRM( JobColumn column, BRMReporter& brmReporter ) // if applicable (indicating an extent with no non-NULL values). int64_t minVal = iter->second.fMinVal; int64_t maxVal = iter->second.fMaxVal; - __int128 bigMinVal = iter->second.fbigMinVal; - __int128 bigMaxVal = iter->second.fbigMaxVal; + int128_t bigMinVal = iter->second.fbigMinVal; + int128_t bigMaxVal = iter->second.fbigMaxVal; if ( bIsChar ) { diff --git a/writeengine/bulk/we_colextinf.h b/writeengine/bulk/we_colextinf.h index 58de88cc2..60930d8ed 100644 --- a/writeengine/bulk/we_colextinf.h +++ b/writeengine/bulk/we_colextinf.h @@ -88,7 +88,7 @@ public: fNewExtent(true) { } // Used to create entry for a new extent, with LBID not yet allocated - ColExtInfEntry(__int128 bigMinVal, __int128 bigMaxVal) : + ColExtInfEntry(int128_t bigMinVal, int128_t bigMaxVal) : fLbid(INVALID_LBID), fNewExtent(true), fbigMinVal(bigMinVal), @@ -102,11 +102,11 @@ public: fNewExtent(true) { } // Used to create entry for a new extent, with LBID not yet allocated - ColExtInfEntry(unsigned __int128 bigMinVal, unsigned __int128 bigMaxVal) : + ColExtInfEntry(uint128_t bigMinVal, uint128_t bigMaxVal) : fLbid(INVALID_LBID), fNewExtent(true), - fbigMinVal(static_cast<__int128>(bigMinVal)), - fbigMaxVal(static_cast<__int128>(bigMaxVal)) { } + fbigMinVal(static_cast(bigMinVal)), + fbigMaxVal(static_cast(bigMaxVal)) { } BRM::LBID_t fLbid; // LBID for an extent; should be the starting LBID int64_t fMinVal; // minimum value for extent associated with LBID @@ -114,12 +114,12 @@ public: bool fNewExtent;// is this a new extent union { - __int128 fbigMinVal; + int128_t fbigMinVal; int64_t fMinVal_; }; union { - __int128 fbigMaxVal; + int128_t fbigMaxVal; int64_t fMaxVal_; }; }; @@ -159,8 +159,8 @@ public: int width ) { } virtual void addOrUpdateEntry( RID lastInputRow, - __int128 minVal, - __int128 maxVal, + int128_t minVal, + int128_t maxVal, ColDataType colDataType, int width ) { } @@ -231,7 +231,7 @@ public: } virtual void addOrUpdateEntry( RID lastInputRow, - __int128 minVal, __int128 maxVal, + int128_t minVal, int128_t maxVal, ColDataType colDataType, int width ) { diff --git a/writeengine/shared/we_type.h b/writeengine/shared/we_type.h index ba77b9409..824058d7f 100644 --- a/writeengine/shared/we_type.h +++ b/writeengine/shared/we_type.h @@ -57,7 +57,6 @@ typedef uint32_t FID; /** @brief File ID */ typedef uint64_t RID; /** @brief Row ID */ typedef uint32_t TxnID; /** @brief Transaction ID (New)*/ typedef uint32_t HWM; /** @brief high water mark */ -typedef unsigned __int128 uint128_t; /************************************************************************ * Type enumerations diff --git a/writeengine/wrapper/we_colop.cpp b/writeengine/wrapper/we_colop.cpp index 3b14b8aae..a7f41e5e5 100644 --- a/writeengine/wrapper/we_colop.cpp +++ b/writeengine/wrapper/we_colop.cpp @@ -56,8 +56,6 @@ struct RefcolInfo unsigned numExtents; }; -using int128_t = __int128; -using uint128_t = unsigned __int128; /** * Constructor