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-1822 add LONG DOUBLE support
This commit is contained in:
@ -636,6 +636,18 @@ ByteStream& ByteStream::operator<<(const double d)
|
||||
|
||||
return *this;
|
||||
}
|
||||
ByteStream& ByteStream::operator<<(const long double d)
|
||||
{
|
||||
int sz = sizeof(long double);
|
||||
|
||||
if (fBuf == 0 || (fCurInPtr - fBuf + sz > fMaxLen + ISSOverhead))
|
||||
growBuf(fMaxLen + BlockSize);
|
||||
|
||||
*((long double*) fCurInPtr) = d;
|
||||
fCurInPtr += sz;
|
||||
|
||||
return *this;
|
||||
}
|
||||
ByteStream& ByteStream::operator>>(float& f)
|
||||
{
|
||||
peek(f);
|
||||
@ -648,6 +660,12 @@ ByteStream& ByteStream::operator>>(double& d)
|
||||
fCurOutPtr += sizeof(double);
|
||||
return *this;
|
||||
}
|
||||
ByteStream& ByteStream::operator>>(long double& d)
|
||||
{
|
||||
peek(d);
|
||||
fCurOutPtr += sizeof(long double);
|
||||
return *this;
|
||||
}
|
||||
void ByteStream::peek(float& f) const
|
||||
{
|
||||
if (length() < sizeof(float))
|
||||
@ -663,6 +681,14 @@ void ByteStream::peek(double& d) const
|
||||
d = *((double*) fCurOutPtr);
|
||||
}
|
||||
|
||||
void ByteStream::peek(long double& d) const
|
||||
{
|
||||
if (length() < sizeof(long double))
|
||||
throw underflow_error("ByteStream>int64_t: not enough data in stream to fill datatype");
|
||||
|
||||
d = *((long double*) fCurOutPtr);
|
||||
}
|
||||
|
||||
|
||||
}//namespace messageqcpp
|
||||
|
||||
|
Reference in New Issue
Block a user