1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

Merge remote-tracking branch 'upstream/develop' into S3-project

This commit is contained in:
Patrick LeBlanc
2019-04-09 10:28:31 -05:00
165 changed files with 5599 additions and 2429 deletions

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2017, MariaDB
Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2019 MariaDB Corporaton
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -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

View File

@ -1,6 +1,6 @@
/*
Copyright (c) 2017, MariaDB
Copyright (C) 2014 InfiniDB, Inc.
Copyright (C) 2019 MariaDB Corporaton
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -153,6 +153,11 @@ public:
* whatever the native byte order is.
*/
EXPORT ByteStream& operator<<(const double d);
/**
* push a long double onto the end of the stream. The byte
* order is whatever the native byte order is.
*/
EXPORT ByteStream& operator<<(const long double d);
/**
* push a std::string onto the end of the stream.
*/
@ -212,6 +217,11 @@ public:
* order is whatever the native byte order is.
*/
EXPORT ByteStream& operator>>(double& d);
/**
* extract a long double from the front of the stream. The byte
* order is whatever the native byte order is.
*/
EXPORT ByteStream& operator>>(long double& d);
/**
* extract a std::string from the front of the stream.
*/
@ -277,6 +287,11 @@ public:
* order is whatever the native byte order is.
*/
EXPORT void peek(double& f) const;
/**
* Peek at a long double from the front of the stream. The byte
* order is whatever the native byte order is.
*/
EXPORT void peek(long double& f) const;
/**
* Peek at a std::string from the front of the stream.
*/