You've already forked mariadb-columnstore-engine
mirror of
https://github.com/mariadb-corporation/mariadb-columnstore-engine.git
synced 2026-01-06 08:21:10 +03:00
Replace getBinaryField
This commit is contained in:
@@ -443,7 +443,7 @@ class Row
|
||||
{
|
||||
if (LIKELY(getColumnWidth(colIndex) == datatypes::MAXDECIMALWIDTH))
|
||||
return datatypes::Decimal(0, (int)getScale(colIndex), getPrecision(colIndex),
|
||||
getBinaryField<int128_t>(colIndex));
|
||||
getTSInt128Field(colIndex).getValPtr());
|
||||
return datatypes::Decimal(datatypes::TSInt64(getIntField(colIndex)), (int)getScale(colIndex),
|
||||
getPrecision(colIndex));
|
||||
}
|
||||
@@ -516,12 +516,7 @@ class Row
|
||||
inline const uint8_t* getVarBinaryField(uint32_t& len, uint32_t colIndex) const;
|
||||
inline void setVarBinaryField(const uint8_t* val, uint32_t len, uint32_t colIndex);
|
||||
|
||||
// inline std::string getBinaryField(uint32_t colIndex) const;
|
||||
template <typename T>
|
||||
inline T* getBinaryField(uint32_t colIndex) const;
|
||||
// To simplify parameter type deduction.
|
||||
template <typename T>
|
||||
inline T* getBinaryField(T* argtype, uint32_t colIndex) const;
|
||||
|
||||
template <typename T>
|
||||
inline T* getBinaryField_offset(uint32_t offset) const;
|
||||
|
||||
@@ -549,7 +544,7 @@ class Row
|
||||
// that's not string-table safe, this one is
|
||||
inline void copyField(Row& dest, uint32_t destIndex, uint32_t srcIndex) const;
|
||||
|
||||
template <typename T>
|
||||
|
||||
inline void copyBinaryField(Row& dest, uint32_t destIndex, uint32_t srcIndex) const;
|
||||
|
||||
std::string toString(uint32_t rownum = 0) const;
|
||||
@@ -1019,17 +1014,6 @@ inline void Row::setStringField(const utils::ConstString& str, uint32_t colIndex
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T* Row::getBinaryField(uint32_t colIndex) const
|
||||
{
|
||||
return getBinaryField_offset<T>(offsets[colIndex]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T* Row::getBinaryField(T* argtype, uint32_t colIndex) const
|
||||
{
|
||||
return getBinaryField_offset<T>(offsets[colIndex]);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
inline T* Row::getBinaryField_offset(uint32_t offset) const
|
||||
@@ -1113,7 +1097,7 @@ inline void Row::getInt128Field(uint32_t colIndex, int128_t& x) const
|
||||
|
||||
inline datatypes::TSInt128 Row::getTSInt128Field(uint32_t colIndex) const
|
||||
{
|
||||
const int128_t* ptr = getBinaryField<int128_t>(colIndex);
|
||||
const int128_t* ptr = reinterpret_cast<int128_t*>(&data[offsets[colIndex]]);;
|
||||
return datatypes::TSInt128(ptr);
|
||||
}
|
||||
|
||||
@@ -1351,7 +1335,7 @@ inline void Row::copyField(Row& out, uint32_t destIndex, uint32_t srcIndex) cons
|
||||
}
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(types[srcIndex], colWidths[srcIndex])))
|
||||
{
|
||||
copyBinaryField<int128_t>(out, destIndex, srcIndex);
|
||||
copyBinaryField(out, destIndex, srcIndex);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1359,10 +1343,10 @@ inline void Row::copyField(Row& out, uint32_t destIndex, uint32_t srcIndex) cons
|
||||
}
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
inline void Row::copyBinaryField(Row& out, uint32_t destIndex, uint32_t srcIndex) const
|
||||
{
|
||||
out.setBinaryField(getBinaryField<T>(srcIndex), destIndex);
|
||||
out.setBinaryField(getTSInt128Field(srcIndex).getValPtr(), destIndex);
|
||||
}
|
||||
|
||||
inline void Row::setRid(uint64_t rid)
|
||||
@@ -1981,7 +1965,7 @@ inline void copyRow(const Row& in, Row* out, uint32_t colCount)
|
||||
}
|
||||
else if (UNLIKELY(datatypes::isWideDecimalType(in.getColType(i), in.getColumnWidth(i))))
|
||||
{
|
||||
in.copyBinaryField<int128_t>(*out, i, i);
|
||||
in.copyBinaryField(*out, i, i);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user