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
Adding mcs_basic_types.h
For now it consists of only: using int128_t = __int128; using uint128_t = unsigned __int128; All new privitive data types should go into this file in the future.
This commit is contained in:
committed by
Roman Nozdrin
parent
916950d1e9
commit
d5c6645ba1
@ -32,10 +32,6 @@ typedef int32_t mcs_sint32_t;
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
|
|
||||||
// Because including my_sys.h in a Columnstore header causes too many conflicts
|
// Because including my_sys.h in a Columnstore header causes too many conflicts
|
||||||
struct charset_info_st;
|
struct charset_info_st;
|
||||||
typedef const struct charset_info_st CHARSET_INFO;
|
typedef const struct charset_info_st CHARSET_INFO;
|
||||||
|
@ -21,11 +21,10 @@
|
|||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
#include <cfloat>
|
#include <cfloat>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "exceptclasses.h"
|
#include "exceptclasses.h"
|
||||||
#include "widedecimalutils.h"
|
#include "widedecimalutils.h"
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
namespace datatypes
|
namespace datatypes
|
||||||
{
|
{
|
||||||
|
@ -39,6 +39,7 @@
|
|||||||
#include <iosfwd>
|
#include <iosfwd>
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "../../writeengine/shared/we_typeext.h"
|
#include "../../writeengine/shared/we_typeext.h"
|
||||||
#include "columnresult.h"
|
#include "columnresult.h"
|
||||||
#include "bytestream.h"
|
#include "bytestream.h"
|
||||||
|
@ -731,12 +731,12 @@ void BatchPrimitiveProcessorJL::deserializeAggregateResult(ByteStream* in,
|
|||||||
}
|
}
|
||||||
|
|
||||||
void BatchPrimitiveProcessorJL::getRowGroupData(ByteStream& in, vector<RGData>* out,
|
void BatchPrimitiveProcessorJL::getRowGroupData(ByteStream& in, vector<RGData>* 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* cachedIO, uint32_t* physIO, uint32_t* touchedBlocks, bool* countThis,
|
||||||
uint32_t threadID, bool* hasWideColumn, const execplan::CalpontSystemCatalog::ColType& colType) const
|
uint32_t threadID, bool* hasWideColumn, const execplan::CalpontSystemCatalog::ColType& colType) const
|
||||||
{
|
{
|
||||||
uint64_t tmp64;
|
uint64_t tmp64;
|
||||||
unsigned __int128 tmp128;
|
uint128_t tmp128;
|
||||||
uint8_t tmp8;
|
uint8_t tmp8;
|
||||||
RGData rgData;
|
RGData rgData;
|
||||||
uint32_t rowCount;
|
uint32_t rowCount;
|
||||||
|
@ -37,6 +37,7 @@
|
|||||||
#include <boost/scoped_ptr.hpp>
|
#include <boost/scoped_ptr.hpp>
|
||||||
#include <boost/uuid/uuid.hpp>
|
#include <boost/uuid/uuid.hpp>
|
||||||
|
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "primitivemsg.h"
|
#include "primitivemsg.h"
|
||||||
#include "serializeable.h"
|
#include "serializeable.h"
|
||||||
#include "primitivestep.h"
|
#include "primitivestep.h"
|
||||||
@ -168,7 +169,7 @@ public:
|
|||||||
void deserializeAggregateResults(messageqcpp::ByteStream* in,
|
void deserializeAggregateResults(messageqcpp::ByteStream* in,
|
||||||
std::vector<rowgroup::RGData>* out) const;
|
std::vector<rowgroup::RGData>* out) const;
|
||||||
void getRowGroupData(messageqcpp::ByteStream& in, std::vector<rowgroup::RGData>* out,
|
void getRowGroupData(messageqcpp::ByteStream& in, std::vector<rowgroup::RGData>* 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* cachedIO, uint32_t* physIO, uint32_t* touchedBlocks, bool* countThis,
|
||||||
uint32_t threadID, bool* hasBinaryColumn, const execplan::CalpontSystemCatalog::ColType& colType) const;
|
uint32_t threadID, bool* hasBinaryColumn, const execplan::CalpontSystemCatalog::ColType& colType) const;
|
||||||
void deserializeAggregateResult(messageqcpp::ByteStream* in,
|
void deserializeAggregateResult(messageqcpp::ByteStream* in,
|
||||||
|
@ -236,7 +236,7 @@ bool LBIDList::GetMinMax(T& min, T& max, int64_t& seq, int64_t lbid,
|
|||||||
|
|
||||||
if (isUnsigned(colDataType))
|
if (isUnsigned(colDataType))
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
mmp->bigMax = 0;
|
mmp->bigMax = 0;
|
||||||
mmp->bigMin = -1;
|
mmp->bigMin = -1;
|
||||||
@ -249,7 +249,7 @@ bool LBIDList::GetMinMax(T& min, T& max, int64_t& seq, int64_t lbid,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
utils::int128Min(mmp->bigMax);
|
utils::int128Min(mmp->bigMax);
|
||||||
utils::int128Max(mmp->bigMin);
|
utils::int128Max(mmp->bigMin);
|
||||||
@ -296,7 +296,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq,
|
|||||||
|
|
||||||
if (isUnsigned(colDataType))
|
if (isUnsigned(colDataType))
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
mmp->bigMax = 0;
|
mmp->bigMax = 0;
|
||||||
mmp->bigMin = -1;
|
mmp->bigMin = -1;
|
||||||
@ -309,7 +309,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
utils::int128Min(mmp->bigMax);
|
utils::int128Min(mmp->bigMax);
|
||||||
utils::int128Max(mmp->bigMin);
|
utils::int128Max(mmp->bigMin);
|
||||||
@ -327,7 +327,7 @@ bool LBIDList::GetMinMax(T* min, T* max, int64_t* seq,
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
*min = entry.partition.cprange.bigLoVal;
|
*min = entry.partition.cprange.bigLoVal;
|
||||||
*max = entry.partition.cprange.bigHiVal;
|
*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 (lbid >= EMEntries[i].range.start && lbid <= lastLBID)
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
min = EMEntries[i].partition.cprange.bigLoVal;
|
min = EMEntries[i].partition.cprange.bigLoVal;
|
||||||
max = EMEntries[i].partition.cprange.bigHiVal;
|
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))
|
else if (datatypes::isUnsigned(type))
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
if (static_cast<unsigned __int128>(min) < static_cast<unsigned __int128>(mmp->bigMin))
|
if (static_cast<uint128_t>(min) < static_cast<uint128_t>(mmp->bigMin))
|
||||||
mmp->bigMin = min;
|
mmp->bigMin = min;
|
||||||
|
|
||||||
if (static_cast<unsigned __int128>(max) > static_cast<unsigned __int128>(mmp->bigMax))
|
if (static_cast<uint128_t>(max) > static_cast<uint128_t>(mmp->bigMax))
|
||||||
mmp->bigMax = max;
|
mmp->bigMax = max;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -445,7 +445,7 @@ void LBIDList::UpdateMinMax(T min, T max, int64_t lbid, CalpontSystemCatalog::Co
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
if (min < mmp->bigMin)
|
if (min < mmp->bigMin)
|
||||||
mmp->bigMin = min;
|
mmp->bigMin = min;
|
||||||
@ -686,7 +686,7 @@ bool LBIDList::checkSingleValue(T min, T max, T value,
|
|||||||
if (isCharType(type))
|
if (isCharType(type))
|
||||||
{
|
{
|
||||||
// MCOL-641 LBIDList::CasualPartitionDataType() returns false if
|
// 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 mmin = order_swap(min);
|
||||||
uint64_t mmax = order_swap(max);
|
uint64_t mmax = order_swap(max);
|
||||||
uint64_t vvalue = order_swap(value);
|
uint64_t vvalue = order_swap(value);
|
||||||
@ -694,10 +694,10 @@ bool LBIDList::checkSingleValue(T min, T max, T value,
|
|||||||
}
|
}
|
||||||
else if (isUnsigned(type))
|
else if (isUnsigned(type))
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
return (static_cast<unsigned __int128>(value) >= static_cast<unsigned __int128>(min) &&
|
return (static_cast<uint128_t>(value) >= static_cast<uint128_t>(min) &&
|
||||||
static_cast<unsigned __int128>(value) <= static_cast<unsigned __int128>(max));
|
static_cast<uint128_t>(value) <= static_cast<uint128_t>(max));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -718,7 +718,7 @@ bool LBIDList::checkRangeOverlap(T min, T max, T tmin, T tmax,
|
|||||||
if (isCharType(type))
|
if (isCharType(type))
|
||||||
{
|
{
|
||||||
// MCOL-641 LBIDList::CasualPartitionDataType() returns false if
|
// 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 min2 = order_swap(min);
|
||||||
uint64_t max2 = order_swap(max);
|
uint64_t max2 = order_swap(max);
|
||||||
uint64_t tmin2 = order_swap(tmin);
|
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))
|
else if (isUnsigned(type))
|
||||||
{
|
{
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
return (static_cast<unsigned __int128>(tmin) <= static_cast<unsigned __int128>(max) &&
|
return (static_cast<uint128_t>(tmin) <= static_cast<uint128_t>(max) &&
|
||||||
static_cast<unsigned __int128>(tmax) >= static_cast<unsigned __int128>(min));
|
static_cast<uint128_t>(tmax) >= static_cast<uint128_t>(min));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -755,7 +755,7 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
const char* MsgDataPtr = (const char*) bs->buf();
|
const char* MsgDataPtr = (const char*) bs->buf();
|
||||||
bool scan = true;
|
bool scan = true;
|
||||||
int64_t value = 0;
|
int64_t value = 0;
|
||||||
__int128 bigValue = 0;
|
int128_t bigValue = 0;
|
||||||
bool bIsUnsigned = datatypes::isUnsigned(ct.colDataType);
|
bool bIsUnsigned = datatypes::isUnsigned(ct.colDataType);
|
||||||
bool bIsChar = datatypes::isCharType(ct.colDataType);
|
bool bIsChar = datatypes::isCharType(ct.colDataType);
|
||||||
|
|
||||||
@ -891,7 +891,7 @@ bool LBIDList::CasualPartitionPredicate(const BRM::EMCasualPartition_t& cpRange,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
scan = compareVal(static_cast<unsigned __int128>(cpRange.bigLoVal), static_cast<unsigned __int128>(cpRange.bigHiVal), static_cast<unsigned __int128>(bigValue), op, lcf);
|
scan = compareVal(static_cast<uint128_t>(cpRange.bigLoVal), static_cast<uint128_t>(cpRange.bigHiVal), static_cast<uint128_t>(bigValue), op, lcf);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -959,7 +959,7 @@ void LBIDList::copyLbidList(const LBIDList& rhs)
|
|||||||
}
|
}
|
||||||
|
|
||||||
template
|
template
|
||||||
bool LBIDList::GetMinMax<__int128>(__int128& min, __int128& max, int64_t& seq, int64_t lbid,
|
bool LBIDList::GetMinMax<int128_t>(int128_t& min, int128_t& max, int64_t& seq, int64_t lbid,
|
||||||
const std::vector<struct BRM::EMEntry>* pEMEntries,
|
const std::vector<struct BRM::EMEntry>* pEMEntries,
|
||||||
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
||||||
template
|
template
|
||||||
@ -968,7 +968,7 @@ bool LBIDList::GetMinMax<int64_t>(int64_t& min, int64_t& max, int64_t& seq, int6
|
|||||||
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
||||||
|
|
||||||
template
|
template
|
||||||
bool LBIDList::GetMinMax<__int128>(__int128* min, __int128* max, int64_t* seq,
|
bool LBIDList::GetMinMax<int128_t>(int128_t* min, int128_t* max, int64_t* seq,
|
||||||
int64_t lbid, const tr1::unordered_map<int64_t, BRM::EMEntry>& entries,
|
int64_t lbid, const tr1::unordered_map<int64_t, BRM::EMEntry>& entries,
|
||||||
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
||||||
|
|
||||||
@ -978,7 +978,7 @@ bool LBIDList::GetMinMax<int64_t>(int64_t* min, int64_t* max, int64_t* seq,
|
|||||||
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
execplan::CalpontSystemCatalog::ColDataType colDataType);
|
||||||
|
|
||||||
template
|
template
|
||||||
void LBIDList::UpdateMinMax<__int128>(__int128 min, __int128 max, int64_t lbid,
|
void LBIDList::UpdateMinMax<int128_t>(int128_t min, int128_t max, int64_t lbid,
|
||||||
execplan::CalpontSystemCatalog::ColDataType type, bool validData = true);
|
execplan::CalpontSystemCatalog::ColDataType type, bool validData = true);
|
||||||
|
|
||||||
template
|
template
|
||||||
@ -986,7 +986,7 @@ void LBIDList::UpdateMinMax<int64_t>(int64_t min, int64_t max, int64_t lbid,
|
|||||||
execplan::CalpontSystemCatalog::ColDataType type, bool validData = true);
|
execplan::CalpontSystemCatalog::ColDataType type, bool validData = true);
|
||||||
|
|
||||||
template
|
template
|
||||||
bool LBIDList::checkSingleValue<__int128>(__int128 min, __int128 max, __int128 value,
|
bool LBIDList::checkSingleValue<int128_t>(int128_t min, int128_t max, int128_t value,
|
||||||
execplan::CalpontSystemCatalog::ColDataType type);
|
execplan::CalpontSystemCatalog::ColDataType type);
|
||||||
|
|
||||||
template
|
template
|
||||||
@ -994,7 +994,7 @@ bool LBIDList::checkSingleValue<int64_t>(int64_t min, int64_t max, int64_t value
|
|||||||
execplan::CalpontSystemCatalog::ColDataType type);
|
execplan::CalpontSystemCatalog::ColDataType type);
|
||||||
|
|
||||||
template
|
template
|
||||||
bool LBIDList::checkRangeOverlap<__int128>(__int128 min, __int128 max, __int128 tmin, __int128 tmax,
|
bool LBIDList::checkRangeOverlap<int128_t>(int128_t min, int128_t max, int128_t tmin, int128_t tmax,
|
||||||
execplan::CalpontSystemCatalog::ColDataType type);
|
execplan::CalpontSystemCatalog::ColDataType type);
|
||||||
|
|
||||||
template
|
template
|
||||||
|
@ -55,12 +55,12 @@ struct MinMaxPartition
|
|||||||
uint32_t blksScanned;
|
uint32_t blksScanned;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min;
|
int64_t min;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max;
|
int64_t max;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -46,6 +46,7 @@
|
|||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
#include <boost/thread/condition.hpp>
|
#include <boost/thread/condition.hpp>
|
||||||
|
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "calpontsystemcatalog.h"
|
#include "calpontsystemcatalog.h"
|
||||||
#include "calpontselectexecutionplan.h"
|
#include "calpontselectexecutionplan.h"
|
||||||
#include "brm.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
|
* Note that it is an adder not a setter. For an extent to be scanned, all calls
|
||||||
* must have a non-empty intersection.
|
* 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<int128_t>& vals, bool isRange,
|
||||||
bool isSmallSideWideDecimal);
|
bool isSmallSideWideDecimal);
|
||||||
|
|
||||||
/* semijoin adds */
|
/* semijoin adds */
|
||||||
|
@ -927,7 +927,7 @@ void TupleBPS::prepCasualPartitioning()
|
|||||||
{
|
{
|
||||||
uint32_t i;
|
uint32_t i;
|
||||||
int64_t min, max, seq;
|
int64_t min, max, seq;
|
||||||
__int128 bigMin, bigMax;
|
int128_t bigMin, bigMax;
|
||||||
boost::mutex::scoped_lock lk(cpMutex);
|
boost::mutex::scoped_lock lk(cpMutex);
|
||||||
|
|
||||||
for (i = 0; i < scannedExtents.size(); i++)
|
for (i = 0; i < scannedExtents.size(); i++)
|
||||||
@ -1889,15 +1889,15 @@ abort:
|
|||||||
struct _CPInfo
|
struct _CPInfo
|
||||||
{
|
{
|
||||||
_CPInfo(int64_t MIN, int64_t MAX, uint64_t l, bool val) : min(MIN), max(MAX), LBID(l), valid(val) { };
|
_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
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min;
|
int64_t min;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max;
|
int64_t max;
|
||||||
};
|
};
|
||||||
uint64_t LBID;
|
uint64_t LBID;
|
||||||
@ -1918,8 +1918,8 @@ void TupleBPS::receiveMultiPrimitiveMessages(uint32_t threadID)
|
|||||||
|
|
||||||
bool validCPData;
|
bool validCPData;
|
||||||
bool hasBinaryColumn;
|
bool hasBinaryColumn;
|
||||||
__int128 min;
|
int128_t min;
|
||||||
__int128 max;
|
int128_t max;
|
||||||
uint64_t lbid;
|
uint64_t lbid;
|
||||||
vector<_CPInfo> cpv;
|
vector<_CPInfo> cpv;
|
||||||
uint32_t cachedIO;
|
uint32_t cachedIO;
|
||||||
@ -3212,7 +3212,7 @@ void TupleBPS::setJoinFERG(const RowGroup& rg)
|
|||||||
fBPP->setJoinFERG(rg);
|
fBPP->setJoinFERG(rg);
|
||||||
}
|
}
|
||||||
|
|
||||||
void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool isRange,
|
void TupleBPS::addCPPredicates(uint32_t OID, const vector<int128_t>& vals, bool isRange,
|
||||||
bool isSmallSideWideDecimal)
|
bool isSmallSideWideDecimal)
|
||||||
{
|
{
|
||||||
|
|
||||||
@ -3221,7 +3221,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool
|
|||||||
|
|
||||||
uint32_t i, j, k;
|
uint32_t i, j, k;
|
||||||
int64_t min, max, seq;
|
int64_t min, max, seq;
|
||||||
__int128 bigMin, bigMax;
|
int128_t bigMin, bigMax;
|
||||||
bool isValid, intersection;
|
bool isValid, intersection;
|
||||||
vector<SCommand> colCmdVec = fBPP->getFilterSteps();
|
vector<SCommand> colCmdVec = fBPP->getFilterSteps();
|
||||||
ColumnCommandJL* cmd;
|
ColumnCommandJL* cmd;
|
||||||
@ -3292,7 +3292,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool
|
|||||||
}
|
}
|
||||||
else
|
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];
|
colType.colDataType) && runtimeCPFlags[j];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -3310,7 +3310,7 @@ void TupleBPS::addCPPredicates(uint32_t OID, const vector<__int128>& vals, bool
|
|||||||
else
|
else
|
||||||
{
|
{
|
||||||
intersection = intersection ||
|
intersection = intersection ||
|
||||||
ll.checkSingleValue((__int128) min, (__int128) max, vals[k], colType.colDataType);
|
ll.checkSingleValue((int128_t) min, (int128_t) max, vals[k], colType.colDataType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,6 +56,7 @@ using namespace std;
|
|||||||
#include <boost/regex.hpp>
|
#include <boost/regex.hpp>
|
||||||
#include <boost/thread.hpp>
|
#include <boost/thread.hpp>
|
||||||
|
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "idb_mysql.h"
|
#include "idb_mysql.h"
|
||||||
|
|
||||||
#define NEED_CALPONT_INTERFACE
|
#define NEED_CALPONT_INTERFACE
|
||||||
@ -145,7 +146,6 @@ namespace cal_impl_if
|
|||||||
extern bool nonConstFunc(Item_func* ifp);
|
extern bool nonConstFunc(Item_func* ifp);
|
||||||
}
|
}
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -16,9 +16,8 @@
|
|||||||
MA 02110-1301, USA. */
|
MA 02110-1301, USA. */
|
||||||
|
|
||||||
#include <gtest/gtest.h> // googletest header file
|
#include <gtest/gtest.h> // googletest header file
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
//using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
//using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
||||||
|
|
||||||
TEST(SimpleCheck, check1)
|
TEST(SimpleCheck, check1)
|
||||||
|
@ -42,7 +42,6 @@
|
|||||||
#define DEBUG
|
#define DEBUG
|
||||||
#define MEMORY_LIMIT 14983602176
|
#define MEMORY_LIMIT 14983602176
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
using namespace joblist;
|
using namespace joblist;
|
||||||
using namespace messageqcpp;
|
using namespace messageqcpp;
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
#define WIDE_DEC_PRECISION 38U
|
#define WIDE_DEC_PRECISION 38U
|
||||||
#define INITIAL_ROW_OFFSET 2
|
#define INITIAL_ROW_OFFSET 2
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
||||||
|
|
||||||
class RowDecimalTest : public ::testing::Test
|
class RowDecimalTest : public ::testing::Test
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
|
|
||||||
namespace static_any
|
namespace static_any
|
||||||
{
|
{
|
||||||
@ -127,8 +128,8 @@ namespace anyimpl
|
|||||||
#define BIG_POLICY(TYPE) template<> struct \
|
#define BIG_POLICY(TYPE) template<> struct \
|
||||||
choose_policy<TYPE> { typedef big_any_policy<TYPE> type; };
|
choose_policy<TYPE> { typedef big_any_policy<TYPE> type; };
|
||||||
|
|
||||||
BIG_POLICY(__int128);
|
BIG_POLICY(int128_t);
|
||||||
BIG_POLICY(unsigned __int128);
|
BIG_POLICY(uint128_t);
|
||||||
|
|
||||||
/// Specializations for small types.
|
/// Specializations for small types.
|
||||||
#define SMALL_POLICY(TYPE) template<> struct \
|
#define SMALL_POLICY(TYPE) template<> struct \
|
||||||
|
@ -29,9 +29,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
|
28
utils/common/mcs_basic_types.h
Normal file
28
utils/common/mcs_basic_types.h
Normal file
@ -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:
|
@ -19,9 +19,7 @@
|
|||||||
#define WIDE_DECIMAL_UTILS_H
|
#define WIDE_DECIMAL_UTILS_H
|
||||||
|
|
||||||
#include <cstdint>
|
#include <cstdint>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
namespace utils
|
namespace utils
|
||||||
{
|
{
|
||||||
|
@ -160,10 +160,6 @@ const int32_t MIN_TIMESTAMP_VALUE = 0;
|
|||||||
namespace dataconvert
|
namespace dataconvert
|
||||||
{
|
{
|
||||||
|
|
||||||
// WIP MCOL-641
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
enum CalpontDateTimeFormat
|
enum CalpontDateTimeFormat
|
||||||
{
|
{
|
||||||
CALPONTDATE_ENUM = 1, // date format is: "YYYY-MM-DD"
|
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;
|
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)
|
inline int128_t strtoll128(const char* data, bool& saturate, char** ep)
|
||||||
{
|
{
|
||||||
int128_t res = 0;
|
int128_t res = 0;
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
|
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "exceptclasses.h"
|
#include "exceptclasses.h"
|
||||||
#include "serializeable.h"
|
#include "serializeable.h"
|
||||||
#include "any.hpp"
|
#include "any.hpp"
|
||||||
@ -45,8 +46,6 @@ class ByteStreamTestSuite;
|
|||||||
#define EXPORT
|
#define EXPORT
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
namespace messageqcpp
|
namespace messageqcpp
|
||||||
{
|
{
|
||||||
|
@ -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::intTypeId((int)1);
|
||||||
const static_any::any& RowAggregation::longTypeId((long)1);
|
const static_any::any& RowAggregation::longTypeId((long)1);
|
||||||
const static_any::any& RowAggregation::llTypeId((long 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::ucharTypeId((unsigned char)1);
|
||||||
const static_any::any& RowAggregation::ushortTypeId((unsigned short)1);
|
const static_any::any& RowAggregation::ushortTypeId((unsigned short)1);
|
||||||
const static_any::any& RowAggregation::uintTypeId((unsigned int)1);
|
const static_any::any& RowAggregation::uintTypeId((unsigned int)1);
|
||||||
const static_any::any& RowAggregation::ulongTypeId((unsigned long)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::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::floatTypeId((float)1);
|
||||||
const static_any::any& RowAggregation::doubleTypeId((double)1);
|
const static_any::any& RowAggregation::doubleTypeId((double)1);
|
||||||
const static_any::any& RowAggregation::longdoubleTypeId((long double)1);
|
const static_any::any& RowAggregation::longdoubleTypeId((long double)1);
|
||||||
|
@ -26,8 +26,6 @@
|
|||||||
#define WIDE_DEC_PRECISION 38U
|
#define WIDE_DEC_PRECISION 38U
|
||||||
#define INITIAL_ROW_OFFSET 2
|
#define INITIAL_ROW_OFFSET 2
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
using CSCDataType = execplan::CalpontSystemCatalog::ColDataType;
|
||||||
|
|
||||||
class RowDecimalTest : public ::testing::Test {
|
class RowDecimalTest : public ::testing::Test {
|
||||||
|
@ -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
|
// 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
|
namespace rowgroup
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -18,6 +18,7 @@
|
|||||||
#include <sstream>
|
#include <sstream>
|
||||||
#include <cstring>
|
#include <cstring>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "mcsv1_udaf.h"
|
#include "mcsv1_udaf.h"
|
||||||
#include "bytestream.h"
|
#include "bytestream.h"
|
||||||
#include "objectreader.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::intTypeId((int)1);
|
||||||
const static_any::any& mcsv1_UDAF::longTypeId((long)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::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::ucharTypeId((unsigned char)1);
|
||||||
const static_any::any& mcsv1_UDAF::ushortTypeId((unsigned short)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::uintTypeId((unsigned int)1);
|
||||||
const static_any::any& mcsv1_UDAF::ulongTypeId((unsigned long)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::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::floatTypeId((float)1);
|
||||||
const static_any::any& mcsv1_UDAF::doubleTypeId((double)1);
|
const static_any::any& mcsv1_UDAF::doubleTypeId((double)1);
|
||||||
const static_any::any& mcsv1_UDAF::strTypeId(typeStr);
|
const static_any::any& mcsv1_UDAF::strTypeId(typeStr);
|
||||||
|
@ -48,9 +48,6 @@ using namespace rowgroup;
|
|||||||
|
|
||||||
#include "joblisttypes.h"
|
#include "joblisttypes.h"
|
||||||
#include "mcs_decimal.h"
|
#include "mcs_decimal.h"
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
|
|
||||||
#include "collation.h"
|
#include "collation.h"
|
||||||
|
|
||||||
// See agg_arg_charsets in sql_type.h to see conversion rules for
|
// See agg_arg_charsets in sql_type.h to see conversion rules for
|
||||||
|
@ -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& intTypeId = (int)1;
|
||||||
static const static_any::any& longTypeId = (long)1;
|
static const static_any::any& longTypeId = (long)1;
|
||||||
static const static_any::any& llTypeId = (long 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& ucharTypeId = (unsigned char)1;
|
||||||
static const static_any::any& ushortTypeId = (unsigned short)1;
|
static const static_any::any& ushortTypeId = (unsigned short)1;
|
||||||
static const static_any::any& uintTypeId = (unsigned int)1;
|
static const static_any::any& uintTypeId = (unsigned int)1;
|
||||||
static const static_any::any& ulongTypeId = (unsigned long)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& 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& floatTypeId = (float)1;
|
||||||
static const static_any::any& doubleTypeId = (double)1;
|
static const static_any::any& doubleTypeId = (double)1;
|
||||||
static const std::string typeStr("");
|
static const std::string typeStr("");
|
||||||
|
@ -31,6 +31,7 @@
|
|||||||
#include <climits>
|
#include <climits>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
#include "mcs_basic_types.h"
|
||||||
#include "logicalpartition.h"
|
#include "logicalpartition.h"
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
@ -153,12 +154,12 @@ struct CPInfo
|
|||||||
int32_t seqNum;
|
int32_t seqNum;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max_;
|
int64_t max_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min_;
|
int64_t min_;
|
||||||
};
|
};
|
||||||
bool isBinaryColumn;
|
bool isBinaryColumn;
|
||||||
@ -173,12 +174,12 @@ struct CPMaxMin
|
|||||||
int32_t seqNum;
|
int32_t seqNum;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max_;
|
int64_t max_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min_;
|
int64_t min_;
|
||||||
};
|
};
|
||||||
bool isBinaryColumn;
|
bool isBinaryColumn;
|
||||||
@ -198,12 +199,12 @@ struct CPInfoMerge
|
|||||||
bool newExtent; // is this to be treated as a new extent
|
bool newExtent; // is this to be treated as a new extent
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max_;
|
int64_t max_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min_;
|
int64_t min_;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -221,12 +222,12 @@ struct CPMaxMinMerge
|
|||||||
bool newExtent;
|
bool newExtent;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMax;
|
int128_t bigMax;
|
||||||
int64_t max_;
|
int64_t max_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMin;
|
int128_t bigMin;
|
||||||
int64_t min_;
|
int64_t min_;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
@ -560,7 +560,7 @@ int DBRM::setExtentsMaxMin(const CPInfoList_t& cpInfos) DBRM_THROW
|
|||||||
{
|
{
|
||||||
if (it->isBinaryColumn)
|
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
|
else
|
||||||
{
|
{
|
||||||
@ -4583,7 +4583,7 @@ void DBRM::invalidateUncommittedExtentLBIDs(execplan::CalpontSystemCatalog::SCN
|
|||||||
}
|
}
|
||||||
|
|
||||||
template
|
template
|
||||||
int DBRM::getExtentMaxMin<__int128>(const LBID_t lbid, __int128& max, __int128& min, int32_t& seqNum) throw();
|
int DBRM::getExtentMaxMin<int128_t>(const LBID_t lbid, int128_t& max, int128_t& min, int32_t& seqNum) throw();
|
||||||
|
|
||||||
template
|
template
|
||||||
int DBRM::getExtentMaxMin<int64_t>(const LBID_t lbid, int64_t& max, int64_t& min, int32_t& seqNum) throw();
|
int DBRM::getExtentMaxMin<int64_t>(const LBID_t lbid, int64_t& max, int64_t& min, int32_t& seqNum) throw();
|
||||||
|
@ -132,7 +132,7 @@ EMCasualPartition_struct::EMCasualPartition_struct(const int64_t lo, const int64
|
|||||||
isValid = CP_INVALID;
|
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;
|
bigLoVal = bigLo;
|
||||||
bigHiVal = bigHi;
|
bigHiVal = bigHi;
|
||||||
@ -890,15 +890,15 @@ void ExtentMap::mergeExtentsMaxMin(CPMaxMinMergeMap_t& cpMap, bool useLock)
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (static_cast<unsigned __int128>(it->second.bigMin) <
|
if (static_cast<uint128_t>(it->second.bigMin) <
|
||||||
static_cast<unsigned __int128>(fExtentMap[i].partition.cprange.bigLoVal))
|
static_cast<uint128_t>(fExtentMap[i].partition.cprange.bigLoVal))
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.bigLoVal =
|
fExtentMap[i].partition.cprange.bigLoVal =
|
||||||
it->second.bigMin;
|
it->second.bigMin;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (static_cast<unsigned __int128>(it->second.bigMax) >
|
if (static_cast<uint128_t>(it->second.bigMax) >
|
||||||
static_cast<unsigned __int128>(fExtentMap[i].partition.cprange.bigHiVal))
|
static_cast<uint128_t>(fExtentMap[i].partition.cprange.bigHiVal))
|
||||||
{
|
{
|
||||||
fExtentMap[i].partition.cprange.bigHiVal =
|
fExtentMap[i].partition.cprange.bigHiVal =
|
||||||
it->second.bigMax;
|
it->second.bigMax;
|
||||||
@ -1033,7 +1033,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst
|
|||||||
{
|
{
|
||||||
if (isUnsigned(type))
|
if (isUnsigned(type))
|
||||||
{
|
{
|
||||||
if (typeid(T) != typeid(__int128))
|
if (typeid(T) != typeid(int128_t))
|
||||||
{
|
{
|
||||||
if ( (static_cast<uint64_t>(min) >= (numeric_limits<uint64_t>::max() - 1)) ||
|
if ( (static_cast<uint64_t>(min) >= (numeric_limits<uint64_t>::max() - 1)) ||
|
||||||
(static_cast<uint64_t>(max) >= (numeric_limits<uint64_t>::max() - 1)) )
|
(static_cast<uint64_t>(max) >= (numeric_limits<uint64_t>::max() - 1)) )
|
||||||
@ -1043,11 +1043,11 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
unsigned __int128 temp;
|
uint128_t temp;
|
||||||
utils::uint128Max(temp);
|
utils::uint128Max(temp);
|
||||||
|
|
||||||
if ( (static_cast<unsigned __int128>(min) >= (temp - 1)) ||
|
if ( (static_cast<uint128_t>(min) >= (temp - 1)) ||
|
||||||
(static_cast<unsigned __int128>(max) >= (temp - 1)) )
|
(static_cast<uint128_t>(max) >= (temp - 1)) )
|
||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -1055,7 +1055,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (typeid(T) != typeid(__int128))
|
if (typeid(T) != typeid(int128_t))
|
||||||
{
|
{
|
||||||
if ( (min <= (numeric_limits<int64_t>::min() + 1)) ||
|
if ( (min <= (numeric_limits<int64_t>::min() + 1)) ||
|
||||||
(max <= (numeric_limits<int64_t>::min() + 1)) )
|
(max <= (numeric_limits<int64_t>::min() + 1)) )
|
||||||
@ -1065,7 +1065,7 @@ bool ExtentMap::isValidCPRange(const T& max, const T& min, execplan::CalpontSyst
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
__int128 temp;
|
int128_t temp;
|
||||||
utils::int128Min(temp);
|
utils::int128Min(temp);
|
||||||
|
|
||||||
if ( (min <= (temp + 1)) ||
|
if ( (min <= (temp + 1)) ||
|
||||||
@ -1105,9 +1105,9 @@ int ExtentMap::getMaxMin(const LBID_t lbid,
|
|||||||
}
|
}
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
if (typeid(T) == typeid(__int128))
|
if (typeid(T) == typeid(int128_t))
|
||||||
{
|
{
|
||||||
__int128 tmpMax, tmpMin;
|
int128_t tmpMax, tmpMin;
|
||||||
utils::int128Min(tmpMax);
|
utils::int128Min(tmpMax);
|
||||||
utils::int128Max(tmpMin);
|
utils::int128Max(tmpMin);
|
||||||
max = tmpMax;
|
max = tmpMax;
|
||||||
@ -1143,7 +1143,7 @@ int ExtentMap::getMaxMin(const LBID_t lbid,
|
|||||||
|
|
||||||
if (lbid >= fExtentMap[i].range.start && lbid <= lastBlock)
|
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;
|
max = fExtentMap[i].partition.cprange.bigHiVal;
|
||||||
min = fExtentMap[i].partition.cprange.bigLoVal;
|
min = fExtentMap[i].partition.cprange.bigLoVal;
|
||||||
@ -6059,7 +6059,7 @@ void ExtentMap::dumpTo(ostream& os)
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
template
|
template
|
||||||
int ExtentMap::getMaxMin<__int128>(const LBID_t lbidRange, __int128& max, __int128& min, int32_t& seqNum);
|
int ExtentMap::getMaxMin<int128_t>(const LBID_t lbidRange, int128_t& max, int128_t& min, int32_t& seqNum);
|
||||||
|
|
||||||
template
|
template
|
||||||
int ExtentMap::getMaxMin<int64_t>(const LBID_t lbidRange, int64_t& max, int64_t& min, int32_t& seqNum);
|
int ExtentMap::getMaxMin<int64_t>(const LBID_t lbidRange, int64_t& max, int64_t& min, int32_t& seqNum);
|
||||||
|
@ -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
|
char isValid; //CP_INVALID - No min/max and no DML in progress. CP_UPDATING - Update in progress. CP_VALID- min/max is valid
|
||||||
union
|
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;
|
int64_t loVal;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigHiVal;
|
int128_t bigHiVal;
|
||||||
int64_t hiVal;
|
int64_t hiVal;
|
||||||
};
|
};
|
||||||
EXPORT EMCasualPartition_struct();
|
EXPORT EMCasualPartition_struct();
|
||||||
EXPORT EMCasualPartition_struct(const int64_t lo, const int64_t hi, const int32_t seqNum);
|
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(const EMCasualPartition_struct& em);
|
||||||
EXPORT EMCasualPartition_struct& operator= (const EMCasualPartition_struct& em);
|
EXPORT EMCasualPartition_struct& operator= (const EMCasualPartition_struct& em);
|
||||||
};
|
};
|
||||||
|
@ -1330,7 +1330,7 @@ void SlaveComm::do_setExtentsMaxMin(ByteStream& msg)
|
|||||||
uint64_t tmp64;
|
uint64_t tmp64;
|
||||||
uint32_t tmp32;
|
uint32_t tmp32;
|
||||||
uint8_t tmp8;
|
uint8_t tmp8;
|
||||||
unsigned __int128 tmp128;
|
uint128_t tmp128;
|
||||||
int err;
|
int err;
|
||||||
ByteStream reply;
|
ByteStream reply;
|
||||||
int32_t updateCount;
|
int32_t updateCount;
|
||||||
|
@ -302,7 +302,7 @@ void BulkLoadBuffer::convert(char* field, int fieldLength,
|
|||||||
int32_t iDate;
|
int32_t iDate;
|
||||||
char charTmpBuf[MAX_COLUMN_BOUNDARY + 1] = {0};
|
char charTmpBuf[MAX_COLUMN_BOUNDARY + 1] = {0};
|
||||||
long long llVal = 0, llDate = 0;
|
long long llVal = 0, llDate = 0;
|
||||||
__int128 bigllVal = 0;
|
int128_t bigllVal = 0;
|
||||||
uint64_t tmp64;
|
uint64_t tmp64;
|
||||||
uint32_t tmp32;
|
uint32_t tmp32;
|
||||||
uint8_t ubiVal;
|
uint8_t ubiVal;
|
||||||
|
@ -45,12 +45,12 @@ public:
|
|||||||
int64_t satCount;
|
int64_t satCount;
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMinBufferVal;
|
int128_t bigMinBufferVal;
|
||||||
int64_t minBufferVal_;
|
int64_t minBufferVal_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 bigMaxBufferVal;
|
int128_t bigMaxBufferVal;
|
||||||
int64_t maxBufferVal_;
|
int64_t maxBufferVal_;
|
||||||
};
|
};
|
||||||
BLBufferStats(ColDataType colDataType) : satCount(0)
|
BLBufferStats(ColDataType colDataType) : satCount(0)
|
||||||
|
@ -92,7 +92,7 @@ void ColExtInf::addOrUpdateEntryTemplate( RID lastInputRow,
|
|||||||
// If all rows had null value for this column, then minVal will be
|
// If all rows had null value for this column, then minVal will be
|
||||||
// MAX_INT and maxVal will be MIN_INT (see getCPInfoForBRM()).
|
// MAX_INT and maxVal will be MIN_INT (see getCPInfoForBRM()).
|
||||||
|
|
||||||
__int128 bigMinValInit;
|
int128_t bigMinValInit;
|
||||||
utils::int128Max(bigMinValInit);
|
utils::int128Max(bigMinValInit);
|
||||||
if ((iter->second.fMinVal == LLONG_MIN && width <= 8) ||
|
if ((iter->second.fMinVal == LLONG_MIN && width <= 8) ||
|
||||||
(iter->second.fbigMinVal == bigMinValInit && width > 8)) // init the range
|
(iter->second.fbigMinVal == bigMinValInit && width > 8)) // init the range
|
||||||
@ -124,12 +124,12 @@ void ColExtInf::addOrUpdateEntryTemplate( RID lastInputRow,
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (static_cast<unsigned __int128>(minVal)
|
if (static_cast<uint128_t>(minVal)
|
||||||
< static_cast<unsigned __int128>(iter->second.fbigMinVal))
|
< static_cast<uint128_t>(iter->second.fbigMinVal))
|
||||||
iter->second.fbigMinVal = minVal;
|
iter->second.fbigMinVal = minVal;
|
||||||
|
|
||||||
if (static_cast<unsigned __int128>(maxVal)
|
if (static_cast<uint128_t>(maxVal)
|
||||||
> static_cast<unsigned __int128>(iter->second.fbigMaxVal))
|
> static_cast<uint128_t>(iter->second.fbigMaxVal))
|
||||||
iter->second.fbigMaxVal = maxVal;
|
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).
|
// if applicable (indicating an extent with no non-NULL values).
|
||||||
int64_t minVal = iter->second.fMinVal;
|
int64_t minVal = iter->second.fMinVal;
|
||||||
int64_t maxVal = iter->second.fMaxVal;
|
int64_t maxVal = iter->second.fMaxVal;
|
||||||
__int128 bigMinVal = iter->second.fbigMinVal;
|
int128_t bigMinVal = iter->second.fbigMinVal;
|
||||||
__int128 bigMaxVal = iter->second.fbigMaxVal;
|
int128_t bigMaxVal = iter->second.fbigMaxVal;
|
||||||
|
|
||||||
if ( bIsChar )
|
if ( bIsChar )
|
||||||
{
|
{
|
||||||
|
@ -88,7 +88,7 @@ public:
|
|||||||
fNewExtent(true) { }
|
fNewExtent(true) { }
|
||||||
|
|
||||||
// Used to create entry for a new extent, with LBID not yet allocated
|
// 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),
|
fLbid(INVALID_LBID),
|
||||||
fNewExtent(true),
|
fNewExtent(true),
|
||||||
fbigMinVal(bigMinVal),
|
fbigMinVal(bigMinVal),
|
||||||
@ -102,11 +102,11 @@ public:
|
|||||||
fNewExtent(true) { }
|
fNewExtent(true) { }
|
||||||
|
|
||||||
// Used to create entry for a new extent, with LBID not yet allocated
|
// 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),
|
fLbid(INVALID_LBID),
|
||||||
fNewExtent(true),
|
fNewExtent(true),
|
||||||
fbigMinVal(static_cast<__int128>(bigMinVal)),
|
fbigMinVal(static_cast<int128_t>(bigMinVal)),
|
||||||
fbigMaxVal(static_cast<__int128>(bigMaxVal)) { }
|
fbigMaxVal(static_cast<int128_t>(bigMaxVal)) { }
|
||||||
|
|
||||||
BRM::LBID_t fLbid; // LBID for an extent; should be the starting LBID
|
BRM::LBID_t fLbid; // LBID for an extent; should be the starting LBID
|
||||||
int64_t fMinVal; // minimum value for extent associated with LBID
|
int64_t fMinVal; // minimum value for extent associated with LBID
|
||||||
@ -114,12 +114,12 @@ public:
|
|||||||
bool fNewExtent;// is this a new extent
|
bool fNewExtent;// is this a new extent
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 fbigMinVal;
|
int128_t fbigMinVal;
|
||||||
int64_t fMinVal_;
|
int64_t fMinVal_;
|
||||||
};
|
};
|
||||||
union
|
union
|
||||||
{
|
{
|
||||||
__int128 fbigMaxVal;
|
int128_t fbigMaxVal;
|
||||||
int64_t fMaxVal_;
|
int64_t fMaxVal_;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
@ -159,8 +159,8 @@ public:
|
|||||||
int width ) { }
|
int width ) { }
|
||||||
|
|
||||||
virtual void addOrUpdateEntry( RID lastInputRow,
|
virtual void addOrUpdateEntry( RID lastInputRow,
|
||||||
__int128 minVal,
|
int128_t minVal,
|
||||||
__int128 maxVal,
|
int128_t maxVal,
|
||||||
ColDataType colDataType,
|
ColDataType colDataType,
|
||||||
int width ) { }
|
int width ) { }
|
||||||
|
|
||||||
@ -231,7 +231,7 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
virtual void addOrUpdateEntry( RID lastInputRow,
|
virtual void addOrUpdateEntry( RID lastInputRow,
|
||||||
__int128 minVal, __int128 maxVal,
|
int128_t minVal, int128_t maxVal,
|
||||||
ColDataType colDataType,
|
ColDataType colDataType,
|
||||||
int width )
|
int width )
|
||||||
{
|
{
|
||||||
|
@ -57,7 +57,6 @@ typedef uint32_t FID; /** @brief File ID */
|
|||||||
typedef uint64_t RID; /** @brief Row ID */
|
typedef uint64_t RID; /** @brief Row ID */
|
||||||
typedef uint32_t TxnID; /** @brief Transaction ID (New)*/
|
typedef uint32_t TxnID; /** @brief Transaction ID (New)*/
|
||||||
typedef uint32_t HWM; /** @brief high water mark */
|
typedef uint32_t HWM; /** @brief high water mark */
|
||||||
typedef unsigned __int128 uint128_t;
|
|
||||||
|
|
||||||
/************************************************************************
|
/************************************************************************
|
||||||
* Type enumerations
|
* Type enumerations
|
||||||
|
@ -56,8 +56,6 @@ struct RefcolInfo
|
|||||||
unsigned numExtents;
|
unsigned numExtents;
|
||||||
};
|
};
|
||||||
|
|
||||||
using int128_t = __int128;
|
|
||||||
using uint128_t = unsigned __int128;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
|
Reference in New Issue
Block a user