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

MCOL-641 Basic support for filtering operations for Decimal38.

This commit is contained in:
Gagan Goel
2020-01-10 17:27:44 -05:00
committed by Roman Nozdrin
parent 77e1d6abe3
commit 49a5573418
6 changed files with 134 additions and 13 deletions

View File

@ -235,6 +235,18 @@ ByteStream& ByteStream::operator<<(const uint64_t o)
return *this;
}
// WIP MCOL-641
ByteStream& ByteStream::operator<<(const unsigned __int128 o)
{
if (fBuf == 0 || (fCurInPtr - fBuf + 16U > fMaxLen + ISSOverhead))
growBuf(fMaxLen + BlockSize);
*((unsigned __int128*) fCurInPtr) = o;
fCurInPtr += 16;
return *this;
}
ByteStream& ByteStream::operator<<(const string& s)
{
int32_t len = s.size();
@ -319,6 +331,14 @@ ByteStream& ByteStream::operator>>(uint64_t& o)
return *this;
}
// WIP MCOL-641
ByteStream& ByteStream::operator>>(unsigned __int128& o)
{
peek(o);
fCurOutPtr += 16;
return *this;
}
ByteStream& ByteStream::operator>>(string& s)
{
peek(s);
@ -399,6 +419,16 @@ void ByteStream::peek(uint64_t& o) const
o = *((uint64_t*) fCurOutPtr);
}
// WIP MCOL-641
void ByteStream::peek(unsigned __int128& o) const
{
if (length() < 16)
throw underflow_error("ByteStream>unsigned __int128: not enough data in stream to fill datatype");
o = *((unsigned __int128*) fCurOutPtr);
}
void ByteStream::peek(string& s) const
{
int32_t len;

View File

@ -143,6 +143,11 @@ public:
* push an uint64_t onto the end of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator<<(const uint64_t o);
// WIP MCOL-641
/**
* push an unsigned __int128 onto the end of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator<<(const unsigned __int128 o);
/**
* push a float onto the end of the stream. The byte order is
* whatever the native byte order is.
@ -207,6 +212,11 @@ public:
* extract an uint64_t from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator>>(uint64_t& o);
// WIP MCOL-641
/**
* extract an unsigned __int128 from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT ByteStream& operator>>(unsigned __int128& o);
/**
* extract a float from the front of the stream. The byte
* order is whatever the native byte order is.
@ -277,6 +287,11 @@ public:
* Peek at an uint64_t from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT void peek(uint64_t& o) const;
// WIP MCOL-641
/**
* Peek at an unsigned __int128 from the front of the stream. The byte order is whatever the native byte order is.
*/
EXPORT void peek(unsigned __int128& o) const;
/**
* Peek at a float from the front of the stream. The byte order
* is whatever the native byte order is.