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

chore(codestyle): mark virtual methods as override

This commit is contained in:
Aleksei Antipovskii
2024-09-12 12:27:02 +02:00
committed by Leonid Fedorov
parent 6001db44ab
commit 5556d818f8
303 changed files with 4091 additions and 4894 deletions

View File

@ -58,7 +58,7 @@ class DataCondition
return mError;
}
// Adjust a sigened integer of any size to the range [-absMaxVal , +absMaxVal]
// Adjust a signed integer of any size to the range [-absMaxVal , +absMaxVal]
template <typename T>
void adjustSIntXRange(T& val, T absMaxVal)
{

View File

@ -125,7 +125,7 @@ struct WidthToSIntegralType<16> : _WidthToSIntegralType<16, int128_t>
{
};
void decimalPrecisionAndScale(const utils::NullString& value, int &precision, int &scale);
void decimalPrecisionAndScale(const utils::NullString& value, int& precision, int& scale);
// XXX: It is assumed here that ALL TYPES have width, scale and precision.
// XXX: And then some of them have the type tag itself.
@ -147,8 +147,8 @@ class TypeAttributesStd
/**
@brief Convenience method to get int128 from a std::string.
*/
int128_t decimal128FromString(const std::string& value, bool* saturate = 0) const;
int128_t decimal128FromString(const utils::NullString& value, bool* saturate = 0) const;
int128_t decimal128FromString(const std::string& value, bool* saturate = nullptr) const;
int128_t decimal128FromString(const utils::NullString& value, bool* saturate = nullptr) const;
/**
@brief The method sets the legacy scale and precision of a wide decimal
@ -507,7 +507,7 @@ class SessionParam
long m_timeZone;
public:
SessionParam(long timeZone) : m_timeZone(timeZone)
explicit SessionParam(long timeZone) : m_timeZone(timeZone)
{
}
long timeZone() const
@ -576,7 +576,7 @@ class SimpleValue
class SimpleValueSInt64 : public SimpleValue
{
public:
SimpleValueSInt64(int64_t value) : SimpleValue(value, 0, 0)
explicit SimpleValueSInt64(int64_t value) : SimpleValue(value, 0, 0)
{
}
};
@ -584,7 +584,7 @@ class SimpleValueSInt64 : public SimpleValue
class SimpleValueUInt64 : public SimpleValue
{
public:
SimpleValueUInt64(uint64_t value) : SimpleValue(static_cast<int64_t>(value), 0, 0)
explicit SimpleValueUInt64(uint64_t value) : SimpleValue(static_cast<int64_t>(value), 0, 0)
{
}
};
@ -592,7 +592,7 @@ class SimpleValueUInt64 : public SimpleValue
class SimpleValueSInt128 : public SimpleValue
{
public:
SimpleValueSInt128(int128_t value) : SimpleValue(0, value, 0)
explicit SimpleValueSInt128(int128_t value) : SimpleValue(0, value, 0)
{
}
};
@ -740,7 +740,7 @@ class MinMaxPartitionInfo : public MinMaxInfo
public:
MinMaxPartitionInfo() : m_status(0){};
MinMaxPartitionInfo(const BRM::EMEntry& entry);
explicit MinMaxPartitionInfo(const BRM::EMEntry& entry);
void set_invalid()
{
m_status |= CPINVALID;
@ -859,8 +859,8 @@ class DatabaseQualifiedColumnName
std::string m_column;
public:
DatabaseQualifiedColumnName(const std::string& db, const std::string& table, const std::string& column)
: m_db(db), m_table(table), m_column(column)
DatabaseQualifiedColumnName(std::string db, std::string table, std::string column)
: m_db(std::move(db)), m_table(std::move(table)), m_column(std::move(column))
{
}
const std::string& db() const
@ -880,9 +880,8 @@ class DatabaseQualifiedColumnName
class StoreField
{
public:
virtual ~StoreField()
{
}
virtual ~StoreField() = default;
virtual int32_t colWidth() const = 0;
virtual int32_t precision() const = 0;
virtual int32_t scale() const = 0;
@ -910,9 +909,8 @@ class StoreField
class WriteBatchField
{
public:
virtual ~WriteBatchField()
{
}
virtual ~WriteBatchField() = default;
virtual size_t ColWriteBatchDate(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
virtual size_t ColWriteBatchDatetime(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
virtual size_t ColWriteBatchTime(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
@ -957,9 +955,8 @@ class TypeHandler
public:
static const TypeHandler* find(SystemCatalog::ColDataType typeCode, const TypeAttributesStd& attr);
static const TypeHandler* find_by_ddltype(const ddlpackage::ColumnType& ct);
virtual ~TypeHandler()
{
}
virtual ~TypeHandler() = default;
virtual const string& name() const = 0;
virtual const string print(const TypeAttributesStd& attr) const
{
@ -985,11 +982,11 @@ class TypeHandler
const SimpleColumnParam& prm) const = 0;
virtual SimpleValue getMinValueSimple() const
{
return SimpleValue(std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::min(), 0);
return {std::numeric_limits<int64_t>::min(), std::numeric_limits<int64_t>::min(), 0};
}
virtual SimpleValue getMaxValueSimple() const
{
return SimpleValue(std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::max(), 0);
return {std::numeric_limits<int64_t>::max(), std::numeric_limits<int64_t>::max(), 0};
}
virtual SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const = 0;
@ -1052,18 +1049,18 @@ class TypeHandlerBit : public TypeHandler
const SimpleColumnParam& prm) const override
{
idbassert(0);
return NULL;
return nullptr;
}
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override
{
idbassert(0);
return SimpleValue();
return {};
}
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
// TODO: How to communicate with write engine?
return boost::any();
return {};
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override;
@ -1808,11 +1805,11 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
}
SimpleValue getMinValueSimple() const override
{
return SimpleValue(std::numeric_limits<int64_t>::min(), datatypes::minInt128, 0);
return {std::numeric_limits<int64_t>::min(), datatypes::minInt128, 0};
}
SimpleValue getMaxValueSimple() const override
{
return SimpleValue(std::numeric_limits<int64_t>::max(), datatypes::maxInt128, 0);
return {std::numeric_limits<int64_t>::max(), datatypes::maxInt128, 0};
}
MinMaxInfo widenMinMaxInfo(const TypeAttributesStd& attr, const MinMaxInfo& a,
const MinMaxInfo& b) const override
@ -1914,7 +1911,7 @@ class TypeHandlerReal : public TypeHandler
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override
{
return SimpleValue(); // QQ: real types were not handled in IDB_format()
return {}; // QQ: real types were not handled in IDB_format()
}
std::string format(const SimpleValue& v, const TypeAttributesStd& attr) const override
{
@ -2047,13 +2044,13 @@ class TypeHandlerSLongDouble : public TypeHandlerReal
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
// QQ: DDLPackageProcessor::getNullValueForType() did not handle LONGDOUBLE
return boost::any();
return {};
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override
{
throw logging::QueryDataExcept("convertColumnData: unknown column data type.", logging::dataTypeErr);
return boost::any();
return {};
}
const uint8_t* getEmptyValueForType(const TypeAttributesStd& attr) const override
{
@ -2255,7 +2252,7 @@ class TypeHandlerClob : public TypeHandlerStr
}
boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{
return boost::any(); // QQ
return {}; // QQ
}
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override;

View File

@ -300,9 +300,9 @@ struct lldiv_t_128
inline lldiv_t_128 lldiv128(const int128_t& dividend, const int128_t& divisor)
{
if (UNLIKELY(divisor == 0) || UNLIKELY(dividend == 0))
return lldiv_t_128();
return {};
return lldiv_t_128(dividend / divisor, dividend % divisor);
return {dividend / divisor, dividend % divisor};
}
// TODO: derive it from TSInt64 eventually
@ -381,9 +381,8 @@ class TDecimal128 : public TSInt128
}
public:
TDecimal128()
{
}
TDecimal128() = default;
explicit TDecimal128(const int128_t val) : TSInt128(val)
{
}
@ -541,11 +540,6 @@ class Decimal : public TDecimal128, public TDecimal64
return TSInt128(s128Value);
}
inline TFloat128 toTFloat128() const
{
return TFloat128(s128Value);
}
inline double toDouble() const
{
int128_t scaleDivisor;
@ -554,7 +548,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<double>(tmpval);
}
inline operator double() const
inline explicit operator double() const
{
return toDouble();
}
@ -567,7 +561,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<float>(tmpval);
}
inline operator float() const
inline explicit operator float() const
{
return toFloat();
}
@ -580,7 +574,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<long double>(tmpval);
}
inline operator long double() const
inline explicit operator long double() const
{
return toLongDouble();
}
@ -1016,7 +1010,6 @@ struct NoOverflowCheck
{
void operator()(const int128_t& x, const int128_t& y)
{
return;
}
};