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
MCOL-641 Clean up primitives code
Add int128_t support into ByteStream Fixed UTs broken after collation patch
This commit is contained in:
@ -235,18 +235,6 @@ ByteStream& ByteStream::operator<<(const uint64_t o)
|
||||
return *this;
|
||||
}
|
||||
|
||||
// WIP MCOL-641
|
||||
ByteStream& ByteStream::operator<<(const int128_t& o)
|
||||
{
|
||||
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
|
||||
growBuf(fMaxLen + BlockSize);
|
||||
|
||||
*((int128_t*) fCurInPtr) = o;
|
||||
fCurInPtr += 16;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
ByteStream& ByteStream::operator<<(const uint128_t& o)
|
||||
{
|
||||
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
|
||||
@ -258,6 +246,17 @@ ByteStream& ByteStream::operator<<(const uint128_t& o)
|
||||
return *this;
|
||||
}
|
||||
|
||||
ByteStream& ByteStream::operator<<(const int128_t& o)
|
||||
{
|
||||
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
|
||||
growBuf(fMaxLen + BlockSize);
|
||||
|
||||
*((int128_t*) fCurInPtr) = o;
|
||||
fCurInPtr += 16;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
ByteStream& ByteStream::operator<<(const string& s)
|
||||
{
|
||||
int32_t len = s.size();
|
||||
@ -342,15 +341,14 @@ ByteStream& ByteStream::operator>>(uint64_t& o)
|
||||
return *this;
|
||||
}
|
||||
|
||||
// WIP MCOL-641
|
||||
ByteStream& ByteStream::operator>>(int128_t& o)
|
||||
ByteStream& ByteStream::operator>>(uint128_t& o)
|
||||
{
|
||||
peek(o);
|
||||
fCurOutPtr += 16;
|
||||
return *this;
|
||||
}
|
||||
|
||||
ByteStream& ByteStream::operator>>(uint128_t& o)
|
||||
ByteStream& ByteStream::operator>>(int128_t& o)
|
||||
{
|
||||
peek(o);
|
||||
fCurOutPtr += 16;
|
||||
@ -437,16 +435,6 @@ void ByteStream::peek(uint64_t& o) const
|
||||
o = *((uint64_t*) fCurOutPtr);
|
||||
}
|
||||
|
||||
// WIP MCOL-641
|
||||
void ByteStream::peek(int128_t& o) const
|
||||
{
|
||||
|
||||
if (length() < 16)
|
||||
throw underflow_error("ByteStream>int128_t: not enough data in stream to fill datatype");
|
||||
|
||||
o = *((int128_t*) fCurOutPtr);
|
||||
}
|
||||
|
||||
void ByteStream::peek(uint128_t& o) const
|
||||
{
|
||||
|
||||
@ -456,6 +444,15 @@ void ByteStream::peek(uint128_t& o) const
|
||||
o = *((uint128_t*) fCurOutPtr);
|
||||
}
|
||||
|
||||
void ByteStream::peek(int128_t& o) const
|
||||
{
|
||||
|
||||
if (length() < 16)
|
||||
throw underflow_error("ByteStream>int128_t: not enough data in stream to fill datatype");
|
||||
|
||||
o = *((int128_t*) fCurOutPtr);
|
||||
}
|
||||
|
||||
void ByteStream::peek(string& s) const
|
||||
{
|
||||
int32_t len;
|
||||
|
Reference in New Issue
Block a user