1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-08-01 06:46:55 +03:00

MCOL-1822 add LONG DOUBLE support

This commit is contained in:
David Hall
2019-01-29 09:55:43 -06:00
parent ee2cb7b0de
commit c5b9ae11e5
40 changed files with 746 additions and 38 deletions

View File

@ -702,6 +702,9 @@ void Row::initToNull()
*((uint64_t*) &data[offsets[i]]) = joblist::DOUBLENULL;
break;
case CalpontSystemCatalog::LONGDOUBLE:
*((long double*) &data[offsets[i]]) = joblist::LONGDOUBLENULL;
case CalpontSystemCatalog::DATETIME:
*((uint64_t*) &data[offsets[i]]) = joblist::DATETIMENULL;
break;
@ -804,13 +807,6 @@ void Row::initToNull()
*((uint64_t*) &data[offsets[i]]) = joblist::UBIGINTNULL;
break;
case CalpontSystemCatalog::LONGDOUBLE:
{
// no NULL value for long double yet, this is a nan.
memset(&data[offsets[i]], 0xFF, getColumnWidth(i));
break;
}
default:
ostringstream os;
os << "Row::initToNull(): got bad column type (" << types[i] <<
@ -956,7 +952,7 @@ bool Row::isNullValue(uint32_t colIndex) const
return (*((uint64_t*) &data[offsets[colIndex]]) == joblist::UBIGINTNULL);
case CalpontSystemCatalog::LONGDOUBLE:
// return false; // no NULL value for long double yet
return (*((long double*) &data[offsets[colIndex]]) == joblist::LONGDOUBLENULL);
break;
default:

View File

@ -330,6 +330,7 @@ public:
template<int len> inline int64_t getIntField(uint32_t colIndex) const;
inline int64_t getIntField(uint32_t colIndex) const;
template<int len> inline bool equals(uint64_t val, uint32_t colIndex) const;
inline bool equals(long double val, uint32_t colIndex) const;
inline bool equals(const std::string& val, uint32_t colIndex) const;
inline double getDoubleField(uint32_t colIndex) const;
@ -616,6 +617,11 @@ inline bool Row::equals(uint64_t val, uint32_t colIndex) const
}
}
inline bool Row::equals(long double val, uint32_t colIndex) const
{
return *((long double*) &data[offsets[colIndex]]) == val;
}
inline bool Row::equals(const std::string& val, uint32_t colIndex) const
{
if (inStringTable(colIndex))