1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-04-18 21:44:02 +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; 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> template <typename T>
void adjustSIntXRange(T& val, T absMaxVal) 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: It is assumed here that ALL TYPES have width, scale and precision.
// XXX: And then some of them have the type tag itself. // 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. @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 std::string& value, bool* saturate = nullptr) const;
int128_t decimal128FromString(const utils::NullString& value, bool* saturate = 0) 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 @brief The method sets the legacy scale and precision of a wide decimal
@ -507,7 +507,7 @@ class SessionParam
long m_timeZone; long m_timeZone;
public: public:
SessionParam(long timeZone) : m_timeZone(timeZone) explicit SessionParam(long timeZone) : m_timeZone(timeZone)
{ {
} }
long timeZone() const long timeZone() const
@ -576,7 +576,7 @@ class SimpleValue
class SimpleValueSInt64 : public SimpleValue class SimpleValueSInt64 : public SimpleValue
{ {
public: 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 class SimpleValueUInt64 : public SimpleValue
{ {
public: 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 class SimpleValueSInt128 : public SimpleValue
{ {
public: 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: public:
MinMaxPartitionInfo() : m_status(0){}; MinMaxPartitionInfo() : m_status(0){};
MinMaxPartitionInfo(const BRM::EMEntry& entry); explicit MinMaxPartitionInfo(const BRM::EMEntry& entry);
void set_invalid() void set_invalid()
{ {
m_status |= CPINVALID; m_status |= CPINVALID;
@ -859,8 +859,8 @@ class DatabaseQualifiedColumnName
std::string m_column; std::string m_column;
public: public:
DatabaseQualifiedColumnName(const std::string& db, const std::string& table, const std::string& column) DatabaseQualifiedColumnName(std::string db, std::string table, std::string column)
: m_db(db), m_table(table), m_column(column) : m_db(std::move(db)), m_table(std::move(table)), m_column(std::move(column))
{ {
} }
const std::string& db() const const std::string& db() const
@ -880,9 +880,8 @@ class DatabaseQualifiedColumnName
class StoreField class StoreField
{ {
public: public:
virtual ~StoreField() virtual ~StoreField() = default;
{
}
virtual int32_t colWidth() const = 0; virtual int32_t colWidth() const = 0;
virtual int32_t precision() const = 0; virtual int32_t precision() const = 0;
virtual int32_t scale() const = 0; virtual int32_t scale() const = 0;
@ -910,9 +909,8 @@ class StoreField
class WriteBatchField class WriteBatchField
{ {
public: public:
virtual ~WriteBatchField() virtual ~WriteBatchField() = default;
{
}
virtual size_t ColWriteBatchDate(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0; 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 ColWriteBatchDatetime(const unsigned char* buf, bool nullVal, ColBatchWriter& ci) = 0;
virtual size_t ColWriteBatchTime(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: public:
static const TypeHandler* find(SystemCatalog::ColDataType typeCode, const TypeAttributesStd& attr); static const TypeHandler* find(SystemCatalog::ColDataType typeCode, const TypeAttributesStd& attr);
static const TypeHandler* find_by_ddltype(const ddlpackage::ColumnType& ct); static const TypeHandler* find_by_ddltype(const ddlpackage::ColumnType& ct);
virtual ~TypeHandler() virtual ~TypeHandler() = default;
{
}
virtual const string& name() const = 0; virtual const string& name() const = 0;
virtual const string print(const TypeAttributesStd& attr) const virtual const string print(const TypeAttributesStd& attr) const
{ {
@ -985,11 +982,11 @@ class TypeHandler
const SimpleColumnParam& prm) const = 0; const SimpleColumnParam& prm) const = 0;
virtual SimpleValue getMinValueSimple() const 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 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, virtual SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const = 0; round_style_t& rf) const = 0;
@ -1052,18 +1049,18 @@ class TypeHandlerBit : public TypeHandler
const SimpleColumnParam& prm) const override const SimpleColumnParam& prm) const override
{ {
idbassert(0); idbassert(0);
return NULL; return nullptr;
} }
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str, SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override round_style_t& rf) const override
{ {
idbassert(0); idbassert(0);
return SimpleValue(); return {};
} }
boost::any getNullValueForType(const TypeAttributesStd& attr) const override boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{ {
// TODO: How to communicate with write engine? // TODO: How to communicate with write engine?
return boost::any(); return {};
} }
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm, boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override; const std::string& str, bool& pushWarning) const override;
@ -1808,11 +1805,11 @@ class TypeHandlerSDecimal128 : public TypeHandlerXDecimal
} }
SimpleValue getMinValueSimple() const override 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 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, MinMaxInfo widenMinMaxInfo(const TypeAttributesStd& attr, const MinMaxInfo& a,
const MinMaxInfo& b) const override const MinMaxInfo& b) const override
@ -1914,7 +1911,7 @@ class TypeHandlerReal : public TypeHandler
SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str, SimpleValue toSimpleValue(const SessionParam& sp, const TypeAttributesStd& attr, const char* str,
round_style_t& rf) const override 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 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 boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{ {
// QQ: DDLPackageProcessor::getNullValueForType() did not handle LONGDOUBLE // QQ: DDLPackageProcessor::getNullValueForType() did not handle LONGDOUBLE
return boost::any(); return {};
} }
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm, boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override const std::string& str, bool& pushWarning) const override
{ {
throw logging::QueryDataExcept("convertColumnData: unknown column data type.", logging::dataTypeErr); throw logging::QueryDataExcept("convertColumnData: unknown column data type.", logging::dataTypeErr);
return boost::any(); return {};
} }
const uint8_t* getEmptyValueForType(const TypeAttributesStd& attr) const override 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 boost::any getNullValueForType(const TypeAttributesStd& attr) const override
{ {
return boost::any(); // QQ return {}; // QQ
} }
boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm, boost::any convertFromString(const TypeAttributesStd& colType, const ConvertFromStringParam& prm,
const std::string& str, bool& pushWarning) const override; 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) inline lldiv_t_128 lldiv128(const int128_t& dividend, const int128_t& divisor)
{ {
if (UNLIKELY(divisor == 0) || UNLIKELY(dividend == 0)) 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 // TODO: derive it from TSInt64 eventually
@ -381,9 +381,8 @@ class TDecimal128 : public TSInt128
} }
public: public:
TDecimal128() TDecimal128() = default;
{
}
explicit TDecimal128(const int128_t val) : TSInt128(val) explicit TDecimal128(const int128_t val) : TSInt128(val)
{ {
} }
@ -541,11 +540,6 @@ class Decimal : public TDecimal128, public TDecimal64
return TSInt128(s128Value); return TSInt128(s128Value);
} }
inline TFloat128 toTFloat128() const
{
return TFloat128(s128Value);
}
inline double toDouble() const inline double toDouble() const
{ {
int128_t scaleDivisor; int128_t scaleDivisor;
@ -554,7 +548,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<double>(tmpval); return static_cast<double>(tmpval);
} }
inline operator double() const inline explicit operator double() const
{ {
return toDouble(); return toDouble();
} }
@ -567,7 +561,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<float>(tmpval); return static_cast<float>(tmpval);
} }
inline operator float() const inline explicit operator float() const
{ {
return toFloat(); return toFloat();
} }
@ -580,7 +574,7 @@ class Decimal : public TDecimal128, public TDecimal64
return static_cast<long double>(tmpval); return static_cast<long double>(tmpval);
} }
inline operator long double() const inline explicit operator long double() const
{ {
return toLongDouble(); return toLongDouble();
} }
@ -1016,7 +1010,6 @@ struct NoOverflowCheck
{ {
void operator()(const int128_t& x, const int128_t& y) void operator()(const int128_t& x, const int128_t& y)
{ {
return;
} }
}; };

View File

@ -349,11 +349,9 @@ enum DDL_SERIAL_TYPE
*/ */
struct SchemaObject struct SchemaObject
{ {
virtual ~SchemaObject() virtual ~SchemaObject() = default;
{
}
SchemaObject(std::string name) : fName(name) explicit SchemaObject(std::string name) : fName(name)
{ {
} }
@ -418,9 +416,7 @@ struct SqlStatement
*/ */
struct SqlStatementList struct SqlStatementList
{ {
SqlStatementList() SqlStatementList() = default;
{
}
SqlStatement* operator[](int i) const SqlStatement* operator[](int i) const
{ {
@ -452,17 +448,13 @@ struct QualifiedName
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
QualifiedName() QualifiedName() = default;
{
}
EXPORT QualifiedName(const char* name); EXPORT explicit QualifiedName(const char* name);
EXPORT QualifiedName(const char* name, const char* schema); EXPORT QualifiedName(const char* name, const char* schema);
EXPORT QualifiedName(const char* name, const char* schema, const char* catalog); EXPORT QualifiedName(const char* name, const char* schema, const char* catalog);
virtual ~QualifiedName() virtual ~QualifiedName() = default;
{
}
std::string fCatalog; std::string fCatalog;
std::string fName; std::string fName;
@ -479,7 +471,7 @@ struct TableDef : public SchemaObject
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
TableDef() : fQualifiedName(0) TableDef() : fQualifiedName(nullptr)
{ {
} }
@ -495,7 +487,7 @@ struct TableDef : public SchemaObject
{ {
} }
EXPORT virtual ~TableDef(); EXPORT ~TableDef() override;
QualifiedName* fQualifiedName; QualifiedName* fQualifiedName;
@ -512,22 +504,22 @@ struct TableDef : public SchemaObject
struct CreateTableStatement : public SqlStatement struct CreateTableStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
EXPORT CreateTableStatement(); EXPORT CreateTableStatement();
/** @brief You can't have a CreateTableStatement without a /** @brief You can't have a CreateTableStatement without a
table defintion */ table defintion */
EXPORT CreateTableStatement(TableDef* tableDef); EXPORT explicit CreateTableStatement(TableDef* tableDef);
EXPORT virtual ~CreateTableStatement(); EXPORT ~CreateTableStatement() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
std::string schemaName() const std::string schemaName() const
{ {
@ -561,13 +553,9 @@ struct AlterTableAction
EXPORT virtual int serialize(messageqcpp::ByteStream& bs) = 0; EXPORT virtual int serialize(messageqcpp::ByteStream& bs) = 0;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AlterTableAction() AlterTableAction() = default;
{
}
virtual ~AlterTableAction() virtual ~AlterTableAction() = default;
{
}
/** @brief QualifiedName of the focal table for this /** @brief QualifiedName of the focal table for this
statement. */ statement. */
@ -582,24 +570,24 @@ struct AlterTableAction
struct AtaAddColumn : public AlterTableAction struct AtaAddColumn : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaAddColumn() : fColumnDef(0) AtaAddColumn() : fColumnDef(nullptr)
{ {
} }
/** @brief You can't add a column without specifying a column /** @brief You can't add a column without specifying a column
definition. */ definition. */
AtaAddColumn(ColumnDef* columnDef); explicit AtaAddColumn(ColumnDef* columnDef);
virtual ~AtaAddColumn(); ~AtaAddColumn() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief The focal column definition. */ /** @brief The focal column definition. */
ColumnDef* fColumnDef; ColumnDef* fColumnDef;
@ -611,22 +599,20 @@ struct AtaAddColumn : public AlterTableAction
struct AtaAddColumns : public AlterTableAction struct AtaAddColumns : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaAddColumns() AtaAddColumns() = default;
{
}
AtaAddColumns(TableElementList* tableElements); explicit AtaAddColumns(TableElementList* tableElements);
virtual ~AtaAddColumns(); ~AtaAddColumns() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
ColumnDefList fColumns; ColumnDefList fColumns;
}; };
@ -637,22 +623,20 @@ struct AtaAddColumns : public AlterTableAction
struct AtaDropColumns : public AlterTableAction struct AtaDropColumns : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaDropColumns() AtaDropColumns() = default;
{
}
EXPORT AtaDropColumns(ColumnNameList* tableElements); EXPORT explicit AtaDropColumns(ColumnNameList* tableElements);
EXPORT virtual ~AtaDropColumns(); EXPORT ~AtaDropColumns() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumns; ColumnNameList fColumns;
}; };
@ -662,22 +646,22 @@ struct AtaDropColumns : public AlterTableAction
struct AtaAddTableConstraint : public AlterTableAction struct AtaAddTableConstraint : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaAddTableConstraint() : fTableConstraint(0) AtaAddTableConstraint() : fTableConstraint(nullptr)
{ {
} }
AtaAddTableConstraint(TableConstraintDef* tableConstraint); explicit AtaAddTableConstraint(TableConstraintDef* tableConstraint);
virtual ~AtaAddTableConstraint(); ~AtaAddTableConstraint() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
TableConstraintDef* fTableConstraint; TableConstraintDef* fTableConstraint;
}; };
@ -687,25 +671,21 @@ struct AtaAddTableConstraint : public AlterTableAction
struct AtaDropColumn : public AlterTableAction struct AtaDropColumn : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaDropColumn() AtaDropColumn() = default;
{
}
/** @brief Ctor for parser construction */ /** @brief Ctor for parser construction */
EXPORT AtaDropColumn(std::string columnName, DDL_REFERENTIAL_ACTION dropBehavior); EXPORT AtaDropColumn(std::string columnName, DDL_REFERENTIAL_ACTION dropBehavior);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropColumn() ~AtaDropColumn() override = default;
{
}
std::string fColumnName; std::string fColumnName;
DDL_REFERENTIAL_ACTION fDropBehavior; DDL_REFERENTIAL_ACTION fDropBehavior;
}; };
@ -715,19 +695,19 @@ struct AtaDropColumn : public AlterTableAction
struct AtaSetColumnDefault : AlterTableAction struct AtaSetColumnDefault : AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
AtaSetColumnDefault() : fDefaultValue(0) AtaSetColumnDefault() : fDefaultValue(nullptr)
{ {
} }
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaSetColumnDefault(); ~AtaSetColumnDefault() override;
AtaSetColumnDefault(const char* colName, ColumnDefaultValue* defaultValue); AtaSetColumnDefault(const char* colName, ColumnDefaultValue* defaultValue);
@ -739,25 +719,21 @@ struct AtaSetColumnDefault : AlterTableAction
struct AtaDropColumnDefault : AlterTableAction struct AtaDropColumnDefault : AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaDropColumnDefault() AtaDropColumnDefault() = default;
{
}
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropColumnDefault() ~AtaDropColumnDefault() override = default;
{
}
/** @brief Ctor for parser construction */ /** @brief Ctor for parser construction */
AtaDropColumnDefault(const char* colName); explicit AtaDropColumnDefault(const char* colName);
std::string fColumnName; std::string fColumnName;
}; };
@ -766,22 +742,18 @@ struct AtaDropColumnDefault : AlterTableAction
struct AtaDropTableConstraint : AlterTableAction struct AtaDropTableConstraint : AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaDropTableConstraint() AtaDropTableConstraint() = default;
{
}
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaDropTableConstraint() ~AtaDropTableConstraint() override = default;
{
}
AtaDropTableConstraint(const char* constraintName, DDL_REFERENTIAL_ACTION dropBehavior); AtaDropTableConstraint(const char* constraintName, DDL_REFERENTIAL_ACTION dropBehavior);
@ -793,21 +765,21 @@ struct AtaDropTableConstraint : AlterTableAction
struct AtaRenameTable : public AlterTableAction struct AtaRenameTable : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaRenameTable() : fQualifiedName(0) AtaRenameTable() : fQualifiedName(nullptr)
{ {
} }
AtaRenameTable(QualifiedName* qualifiedName); explicit AtaRenameTable(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaRenameTable(); ~AtaRenameTable() override;
QualifiedName* fQualifiedName; QualifiedName* fQualifiedName;
}; };
@ -816,21 +788,21 @@ struct AtaRenameTable : public AlterTableAction
struct AtaTableComment : public AlterTableAction struct AtaTableComment : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaTableComment() : fTableComment("") AtaTableComment() : fTableComment("")
{ {
} }
AtaTableComment(const char* tableComment); explicit AtaTableComment(const char* tableComment);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaTableComment(); ~AtaTableComment() override;
std::string fTableComment; std::string fTableComment;
}; };
@ -839,13 +811,13 @@ struct AtaTableComment : public AlterTableAction
struct AtaModifyColumnType : public AlterTableAction struct AtaModifyColumnType : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaModifyColumnType() : fColumnType(0) AtaModifyColumnType() : fColumnType(nullptr)
{ {
} }
@ -854,12 +826,12 @@ struct AtaModifyColumnType : public AlterTableAction
{ {
} }
AtaModifyColumnType(QualifiedName* qualifiedName); explicit AtaModifyColumnType(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaModifyColumnType(); ~AtaModifyColumnType() override;
ColumnType* fColumnType; ColumnType* fColumnType;
@ -870,28 +842,28 @@ struct AtaModifyColumnType : public AlterTableAction
struct AtaRenameColumn : public AlterTableAction struct AtaRenameColumn : public AlterTableAction
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
AtaRenameColumn() : fNewType(0), fDefaultValue(0) AtaRenameColumn() : fNewType(nullptr), fDefaultValue(nullptr)
{ {
} }
AtaRenameColumn(const char* name, const char* newName, ColumnType* newType, const char* comment = NULL) AtaRenameColumn(const char* name, const char* newName, ColumnType* newType, const char* comment = nullptr)
: fName(name), fNewName(newName), fNewType(newType) : fName(name), fNewName(newName), fNewType(newType)
{ {
if (comment) if (comment)
fComment = comment; fComment = comment;
fDefaultValue = 0; fDefaultValue = nullptr;
} }
AtaRenameColumn(const char* name, const char* newName, ColumnType* newType, AtaRenameColumn(const char* name, const char* newName, ColumnType* newType,
ColumnConstraintList* constraint_list, ColumnDefaultValue* defaultValue, ColumnConstraintList* constraint_list, ColumnDefaultValue* defaultValue,
const char* comment = NULL) const char* comment = nullptr)
: fName(name), fNewName(newName), fNewType(newType), fDefaultValue(defaultValue) : fName(name), fNewName(newName), fNewType(newType), fDefaultValue(defaultValue)
{ {
if (constraint_list) if (constraint_list)
@ -906,12 +878,12 @@ struct AtaRenameColumn : public AlterTableAction
fComment = comment; fComment = comment;
} }
AtaRenameColumn(QualifiedName* qualifiedName); explicit AtaRenameColumn(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~AtaRenameColumn(); ~AtaRenameColumn() override;
std::string fName; ///< current column name std::string fName; ///< current column name
std::string fNewName; ///< new column name std::string fNewName; ///< new column name
@ -935,7 +907,7 @@ struct ColumnType
EXPORT int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs);
/** @brief For deserialization. */ /** @brief For deserialization. */
ColumnType() : fCharset(NULL), fCollate(NULL), fCharsetNum(0), fExplicitLength(false) ColumnType() : fCharset(nullptr), fCollate(nullptr), fCharsetNum(0), fExplicitLength(false)
{ {
} }
@ -951,9 +923,7 @@ struct ColumnType
EXPORT ColumnType(int type); EXPORT ColumnType(int type);
virtual ~ColumnType() virtual ~ColumnType() = default;
{
}
/** @brief Type code from DDL_DATATYPES */ /** @brief Type code from DDL_DATATYPES */
int fType; int fType;
@ -1003,19 +973,15 @@ struct ColumnConstraintDef : public SchemaObject
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
ColumnConstraintDef() ColumnConstraintDef() = default;
{
}
/** @brief Constructs as check constraint. */ /** @brief Constructs as check constraint. */
EXPORT ColumnConstraintDef(const char* check); EXPORT explicit ColumnConstraintDef(const char* check);
/** @brief Constructs as other constraint. */ /** @brief Constructs as other constraint. */
EXPORT ColumnConstraintDef(DDL_CONSTRAINTS type); EXPORT explicit ColumnConstraintDef(DDL_CONSTRAINTS type);
virtual ~ColumnConstraintDef() ~ColumnConstraintDef() override = default;
{
}
/** @brief Whether deferrable. */ /** @brief Whether deferrable. */
bool fDeferrable; bool fDeferrable;
@ -1039,15 +1005,11 @@ struct ColumnDefaultValue
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); virtual int serialize(messageqcpp::ByteStream& bs);
ColumnDefaultValue() ColumnDefaultValue() = default;
{
}
ColumnDefaultValue(const char* value); explicit ColumnDefaultValue(const char* value);
virtual ~ColumnDefaultValue() virtual ~ColumnDefaultValue() = default;
{
}
/** @brief Is NULL the default value? */ /** @brief Is NULL the default value? */
bool fNull; bool fNull;
@ -1067,20 +1029,20 @@ struct ColumnDef : public SchemaObject
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT virtual int serialize(messageqcpp::ByteStream& bs);
/** @brief For deserialization. */ /** @brief For deserialization. */
ColumnDef() : fType(0) ColumnDef() : fType(nullptr)
{ {
} }
EXPORT virtual ~ColumnDef(); EXPORT ~ColumnDef() override;
/** @brief Parser ctor. */ /** @brief Parser ctor. */
EXPORT ColumnDef(const char* name, ColumnType* type, ColumnConstraintList* constraint_list, EXPORT ColumnDef(const char* name, ColumnType* type, ColumnConstraintList* constraint_list,
ColumnDefaultValue* defaultValue, const char* comment = NULL); ColumnDefaultValue* defaultValue, const char* comment = nullptr);
/** @brief ColumnDef ctor. /** @brief ColumnDef ctor.
* ctor */ * ctor */
ColumnDef(const char* name, ColumnType* type, ColumnConstraintList constraints, ColumnDef(const char* name, ColumnType* type, ColumnConstraintList constraints,
ColumnDefaultValue* defaultValue = NULL, const char* comment = NULL) ColumnDefaultValue* defaultValue = nullptr, const char* comment = nullptr)
: SchemaObject(name), fType(type), fConstraints(constraints), fDefaultValue(defaultValue) : SchemaObject(name), fType(type), fConstraints(constraints), fDefaultValue(defaultValue)
{ {
} }
@ -1114,14 +1076,12 @@ struct TableConstraintDef : public SchemaObject
TableConstraintDef(); TableConstraintDef();
TableConstraintDef(DDL_CONSTRAINTS cType); explicit TableConstraintDef(DDL_CONSTRAINTS cType);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; virtual std::ostream& put(std::ostream& os) const;
virtual ~TableConstraintDef() ~TableConstraintDef() override = default;
{
}
// std::string fName; // std::string fName;
DDL_CONSTRAINTS fConstraintType; DDL_CONSTRAINTS fConstraintType;
}; };
@ -1131,28 +1091,26 @@ struct TableConstraintDef : public SchemaObject
struct TableUniqueConstraintDef : public TableConstraintDef struct TableUniqueConstraintDef : public TableConstraintDef
{ {
/** @brief Return DDL_SERIAL code */ /** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType() DDL_SERIAL_TYPE getSerialType() override
{ {
return DDL_TABLE_UNIQUE_CONSTRAINT_DEF; return DDL_TABLE_UNIQUE_CONSTRAINT_DEF;
} }
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
TableUniqueConstraintDef() : TableConstraintDef(DDL_UNIQUE) TableUniqueConstraintDef() : TableConstraintDef(DDL_UNIQUE)
{ {
} }
TableUniqueConstraintDef(ColumnNameList* columns); explicit TableUniqueConstraintDef(ColumnNameList* columns);
virtual ~TableUniqueConstraintDef() ~TableUniqueConstraintDef() override = default;
{
}
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumnNameList; ColumnNameList fColumnNameList;
}; };
@ -1162,29 +1120,27 @@ struct TableUniqueConstraintDef : public TableConstraintDef
struct TablePrimaryKeyConstraintDef : public TableConstraintDef struct TablePrimaryKeyConstraintDef : public TableConstraintDef
{ {
/** @brief Return DDL_SERIAL code */ /** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType() DDL_SERIAL_TYPE getSerialType() override
{ {
return DDL_TABLE_PRIMARY_CONSTRAINT_DEF; return DDL_TABLE_PRIMARY_CONSTRAINT_DEF;
} }
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
TablePrimaryKeyConstraintDef() : TableConstraintDef(DDL_PRIMARY_KEY) TablePrimaryKeyConstraintDef() : TableConstraintDef(DDL_PRIMARY_KEY)
{ {
} }
EXPORT TablePrimaryKeyConstraintDef(ColumnNameList* columns); EXPORT explicit TablePrimaryKeyConstraintDef(ColumnNameList* columns);
virtual ~TablePrimaryKeyConstraintDef() ~TablePrimaryKeyConstraintDef() override = default;
{
}
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumnNameList; ColumnNameList fColumnNameList;
}; };
@ -1194,9 +1150,7 @@ struct TablePrimaryKeyConstraintDef : public TableConstraintDef
*/ */
struct ReferentialAction struct ReferentialAction
{ {
virtual ~ReferentialAction() virtual ~ReferentialAction() = default;
{
}
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); virtual int unserialize(messageqcpp::ByteStream& bs);
@ -1213,18 +1167,19 @@ struct ReferentialAction
struct TableReferencesConstraintDef : public TableConstraintDef struct TableReferencesConstraintDef : public TableConstraintDef
{ {
/** @brief Return DDL_SERIAL code */ /** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType() DDL_SERIAL_TYPE getSerialType() override
{ {
return DDL_TABLE_REFERENCES_CONSTRAINT_DEF; return DDL_TABLE_REFERENCES_CONSTRAINT_DEF;
} }
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
TableReferencesConstraintDef() : TableConstraintDef(DDL_REFERENCES), fTableName(0), fRefAction(0) TableReferencesConstraintDef()
: TableConstraintDef(DDL_REFERENCES), fTableName(nullptr), fRefAction(nullptr)
{ {
} }
@ -1232,10 +1187,10 @@ struct TableReferencesConstraintDef : public TableConstraintDef
ColumnNameList* foreignColumns, DDL_MATCH_TYPE matchType, ColumnNameList* foreignColumns, DDL_MATCH_TYPE matchType,
ReferentialAction* refAction); ReferentialAction* refAction);
virtual ~TableReferencesConstraintDef(); ~TableReferencesConstraintDef() override;
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
ColumnNameList fColumns; ColumnNameList fColumns;
QualifiedName* fTableName; QualifiedName* fTableName;
@ -1249,29 +1204,27 @@ struct TableReferencesConstraintDef : public TableConstraintDef
struct TableCheckConstraintDef : public TableConstraintDef struct TableCheckConstraintDef : public TableConstraintDef
{ {
/** @brief Return DDL_SERIAL code */ /** @brief Return DDL_SERIAL code */
virtual DDL_SERIAL_TYPE getSerialType() DDL_SERIAL_TYPE getSerialType() override
{ {
return DDL_TABLE_CHECK_CONSTRAINT_DEF; return DDL_TABLE_CHECK_CONSTRAINT_DEF;
} }
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
TableCheckConstraintDef() : TableConstraintDef(DDL_CHECK) TableCheckConstraintDef() : TableConstraintDef(DDL_CHECK)
{ {
} }
TableCheckConstraintDef(const char* check); explicit TableCheckConstraintDef(const char* check);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~TableCheckConstraintDef() ~TableCheckConstraintDef() override = default;
{
}
std::string fCheck; std::string fCheck;
}; };
@ -1284,22 +1237,22 @@ struct TableCheckConstraintDef : public TableConstraintDef
struct AlterTableStatement : public SqlStatement struct AlterTableStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
AlterTableStatement() : fTableName(0) AlterTableStatement() : fTableName(nullptr)
{ {
} }
EXPORT AlterTableStatement(QualifiedName* qName, AlterTableActionList* ataList); EXPORT AlterTableStatement(QualifiedName* qName, AlterTableActionList* ataList);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
/** @brief Delete members. */ /** @brief Delete members. */
EXPORT virtual ~AlterTableStatement(); EXPORT ~AlterTableStatement() override;
std::string schemaName() const std::string schemaName() const
{ {
@ -1341,18 +1294,14 @@ struct ConstraintAttributes
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); virtual int serialize(messageqcpp::ByteStream& bs);
ConstraintAttributes() ConstraintAttributes() = default;
{
}
ConstraintAttributes(DDL_CONSTRAINT_ATTRIBUTES checkTime, bool deferrable) ConstraintAttributes(DDL_CONSTRAINT_ATTRIBUTES checkTime, bool deferrable)
: fCheckTime(checkTime), fDeferrable(deferrable) : fCheckTime(checkTime), fDeferrable(deferrable)
{ {
} }
virtual ~ConstraintAttributes() virtual ~ConstraintAttributes() = default;
{
}
DDL_CONSTRAINT_ATTRIBUTES fCheckTime; DDL_CONSTRAINT_ATTRIBUTES fCheckTime;
bool fDeferrable; bool fDeferrable;
@ -1366,19 +1315,19 @@ struct ConstraintAttributes
struct CreateIndexStatement : public SqlStatement struct CreateIndexStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
CreateIndexStatement(); CreateIndexStatement();
CreateIndexStatement(QualifiedName* qualifiedName1, QualifiedName* qualifiedName2, CreateIndexStatement(QualifiedName* qualifiedName1, QualifiedName* qualifiedName2,
ColumnNameList* columnNames, bool unique); ColumnNameList* columnNames, bool unique);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~CreateIndexStatement(); ~CreateIndexStatement() override;
QualifiedName* fIndexName; QualifiedName* fIndexName;
QualifiedName* fTableName; QualifiedName* fTableName;
@ -1391,20 +1340,20 @@ struct CreateIndexStatement : public SqlStatement
struct DropIndexStatement : public SqlStatement struct DropIndexStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
virtual int unserialize(messageqcpp::ByteStream& bs); int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
virtual int serialize(messageqcpp::ByteStream& bs); int serialize(messageqcpp::ByteStream& bs) override;
DropIndexStatement() : fIndexName(0) DropIndexStatement() : fIndexName(nullptr)
{ {
} }
DropIndexStatement(QualifiedName* qualifiedName); explicit DropIndexStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
virtual ~DropIndexStatement(); ~DropIndexStatement() override;
QualifiedName* fIndexName; QualifiedName* fIndexName;
}; };
@ -1414,20 +1363,20 @@ struct DropIndexStatement : public SqlStatement
struct DropTableStatement : public SqlStatement struct DropTableStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
DropTableStatement() : fTableName(0) DropTableStatement() : fTableName(nullptr)
{ {
} }
EXPORT DropTableStatement(QualifiedName* qualifiedName, bool cascade); EXPORT DropTableStatement(QualifiedName* qualifiedName, bool cascade);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~DropTableStatement() ~DropTableStatement() override
{ {
delete fTableName; delete fTableName;
} }
@ -1473,20 +1422,20 @@ struct DebugDDLStatement : public SqlStatement
struct TruncTableStatement : public SqlStatement struct TruncTableStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
TruncTableStatement() : fTableName(0) TruncTableStatement() : fTableName(nullptr)
{ {
} }
EXPORT TruncTableStatement(QualifiedName* qualifiedName); EXPORT explicit TruncTableStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~TruncTableStatement() ~TruncTableStatement() override
{ {
delete fTableName; delete fTableName;
} }
@ -1508,23 +1457,23 @@ struct TruncTableStatement : public SqlStatement
struct MarkPartitionStatement : public SqlStatement struct MarkPartitionStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
MarkPartitionStatement() : fTableName(0) MarkPartitionStatement() : fTableName(nullptr)
{ {
} }
/** @brief You can't have a CreateTableStatement without a table defintion */ /** @brief You can't have a CreateTableStatement without a table defintion */
EXPORT MarkPartitionStatement(QualifiedName* qualifiedName); EXPORT explicit MarkPartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~MarkPartitionStatement() ~MarkPartitionStatement() override
{ {
delete fTableName; delete fTableName;
} }
@ -1539,22 +1488,22 @@ struct MarkPartitionStatement : public SqlStatement
struct RestorePartitionStatement : public SqlStatement struct RestorePartitionStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
RestorePartitionStatement() : fTableName(0) RestorePartitionStatement() : fTableName(nullptr)
{ {
} }
EXPORT RestorePartitionStatement(QualifiedName* qualifiedName); EXPORT explicit RestorePartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~RestorePartitionStatement() ~RestorePartitionStatement() override
{ {
delete fTableName; delete fTableName;
} }
@ -1569,22 +1518,22 @@ struct RestorePartitionStatement : public SqlStatement
struct DropPartitionStatement : public SqlStatement struct DropPartitionStatement : public SqlStatement
{ {
/** @brief Deserialize from ByteStream */ /** @brief Deserialize from ByteStream */
EXPORT virtual int unserialize(messageqcpp::ByteStream& bs); EXPORT int unserialize(messageqcpp::ByteStream& bs) override;
/** @brief Serialize to ByteStream */ /** @brief Serialize to ByteStream */
EXPORT virtual int serialize(messageqcpp::ByteStream& bs); EXPORT int serialize(messageqcpp::ByteStream& bs) override;
/** @brief Ctor for deserialization */ /** @brief Ctor for deserialization */
DropPartitionStatement() : fTableName(0) DropPartitionStatement() : fTableName(nullptr)
{ {
} }
EXPORT DropPartitionStatement(QualifiedName* qualifiedName); EXPORT explicit DropPartitionStatement(QualifiedName* qualifiedName);
/** @brief Dump to stdout. */ /** @brief Dump to stdout. */
EXPORT virtual std::ostream& put(std::ostream& os) const; EXPORT std::ostream& put(std::ostream& os) const override;
virtual ~DropPartitionStatement() ~DropPartitionStatement() override
{ {
delete fTableName; delete fTableName;
} }

View File

@ -29,7 +29,7 @@
#include <stdexcept> #include <stdexcept>
#include "collation.h" // CHARSET_INFO #include "collation.h" // CHARSET_INFO
#include "ddlpkg.h" #include "ddlpkg.h"
#include "mariadb_my_sys.h" // myf, MYF() #include "mariadb_my_sys.h" // myf, MYF()
#define EXPORT #define EXPORT
@ -86,12 +86,8 @@ struct pass_to_bison
const CHARSET_INFO* default_table_charset; const CHARSET_INFO* default_table_charset;
myf utf8_flag; myf utf8_flag;
pass_to_bison(ParseTree* pt) : pass_to_bison(ParseTree* pt)
fParseTree(pt) : fParseTree(pt), scanner(nullptr), default_table_charset(nullptr), utf8_flag(MYF(0)){};
, scanner(NULL)
, default_table_charset(NULL)
, utf8_flag(MYF(0))
{};
}; };
class SqlParser class SqlParser

View File

@ -49,7 +49,7 @@ class CreateTableProcessor : public DDLPackageProcessor
* *
* @param createTableStmt the CreateTableStatement * @param createTableStmt the CreateTableStatement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* sqlTableStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* sqlTableStmt) override;
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor

View File

@ -22,7 +22,7 @@
***********************************************************************/ ***********************************************************************/
/** @file */ /** @file */
#ifndef DDLINDEXPOPULATOR_H #pragma once
#include <string> #include <string>
#include <stdexcept> #include <stdexcept>
@ -302,5 +302,4 @@ class DDLIndexPopulator
}; };
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor
#endif // DDLPINDEXPOPULATOR_H

View File

@ -29,7 +29,7 @@
#include <stdexcept> #include <stdexcept>
#include <sstream> #include <sstream>
#include <iostream> #include <iostream>
#include <stdint.h> #include <cstdint>
#include <boost/any.hpp> #include <boost/any.hpp>
#include <boost/tuple/tuple.hpp> #include <boost/tuple/tuple.hpp>
@ -49,7 +49,7 @@
#define EXPORT #define EXPORT
//#define IDB_DDL_DEBUG // #define IDB_DDL_DEBUG
namespace ddlpackageprocessor namespace ddlpackageprocessor
{ {
#define SUMMARY_INFO(message) \ #define SUMMARY_INFO(message) \
@ -206,8 +206,8 @@ class DDLPackageProcessor
struct NJLSysDataList struct NJLSysDataList
{ {
NJLSysDataVector sysDataVec; NJLSysDataVector sysDataVec;
EXPORT NJLSysDataList(){}; EXPORT NJLSysDataList() = default;
EXPORT ~NJLSysDataList(); EXPORT ~NJLSysDataList() = default;
NJLSysDataVector::const_iterator begin() NJLSysDataVector::const_iterator begin()
{ {
return sysDataVec.begin(); return sysDataVec.begin();

View File

@ -38,7 +38,7 @@ class DropIndexProcessor : public DDLPackageProcessor
* *
* @param dropIndexStmt the drop index statement * @param dropIndexStmt the drop index statement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement& dropIndexStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* dropIndexStmt) override;
protected: protected:
private: private:

View File

@ -46,7 +46,7 @@ class DropPartitionProcessor : public DDLPackageProcessor, FormatStatementString
* *
* @param dropTableStmt the drop table statement * @param dropTableStmt the drop table statement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropPartitionStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* dropPartitionStmt) override;
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class DropTableProcessor : public DDLPackageProcessor
* *
* @param dropTableStmt the drop table statement * @param dropTableStmt the drop table statement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* dropTableStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* dropTableStmt) override;
}; };
/** @brief specialization of a DDLPacakageProcessor /** @brief specialization of a DDLPacakageProcessor
@ -66,7 +66,7 @@ class TruncTableProcessor : public DDLPackageProcessor
* *
* @param truncTableStmt the truncate table statement * @param truncTableStmt the truncate table statement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* truncTableStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* truncTableStmt) override;
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class MarkPartitionProcessor : public DDLPackageProcessor, FormatStatementString
* *
* @param createTableStmt the CreateTableStatement * @param createTableStmt the CreateTableStatement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* MarkPartitionStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* MarkPartitionStmt) override;
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor

View File

@ -46,7 +46,7 @@ class RestorePartitionProcessor : public DDLPackageProcessor, FormatStatementStr
* *
* @param dropTableStmt the drop table statement * @param dropTableStmt the drop table statement
*/ */
DDLResult processPackageInternal(ddlpackage::SqlStatement* RestorePartitionStmt); DDLResult processPackageInternal(ddlpackage::SqlStatement* RestorePartitionStmt) override;
}; };
} // namespace ddlpackageprocessor } // namespace ddlpackageprocessor

View File

@ -188,7 +188,7 @@ class CalpontDMLPackage
{ {
fTableName = tableName; fTableName = tableName;
if (fTable != 0) if (fTable != nullptr)
fTable->set_TableName(tableName); fTable->set_TableName(tableName);
} }
@ -207,7 +207,7 @@ class CalpontDMLPackage
{ {
fSchemaName = schemaName; fSchemaName = schemaName;
if (fTable != 0) if (fTable != nullptr)
fTable->set_SchemaName(schemaName); fTable->set_SchemaName(schemaName);
} }

View File

@ -47,33 +47,33 @@ class CommandDMLPackage : public CalpontDMLPackage
/** @brief dtor /** @brief dtor
*/ */
EXPORT virtual ~CommandDMLPackage(); EXPORT ~CommandDMLPackage() override;
/** @brief write a CommandDMLPackage to a ByteStream /** @brief write a CommandDMLPackage to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read CommandDMLPackage from bytestream /** @brief read CommandDMLPackage from bytestream
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief do nothing /** @brief do nothing
* *
* @param buffer * @param buffer
* @param columns the number of columns in the buffer * @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
inline int buildFromBuffer(std::string& buffer, int columns = 0, int rows = 0) inline int buildFromBuffer(std::string& buffer, int columns = 0, int rows = 0) override
{ {
return 1; return 1;
}; };
/** @brief build a CommandDMLPackage from a CommandSqlStatement /** @brief build a CommandDMLPackage from a CommandSqlStatement
*/ */
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement); EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer /** @brief build a InsertDMLPackage from MySQL buffer
* *
@ -81,7 +81,7 @@ class CommandDMLPackage : public CalpontDMLPackage
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows, int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows,
NullValuesBitset& nullValues) NullValuesBitset& nullValues) override
{ {
return 1; return 1;
}; };

View File

@ -53,19 +53,19 @@ class DeleteDMLPackage : public CalpontDMLPackage
/** @brief dtor /** @brief dtor
*/ */
EXPORT virtual ~DeleteDMLPackage(); EXPORT ~DeleteDMLPackage() override;
/** @brief write a DeleteDMLPackage to a ByteStream /** @brief write a DeleteDMLPackage to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read a DeleteDMLPackage from a ByteStream /** @brief read a DeleteDMLPackage from a ByteStream
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief build a DeleteDMLPackage from a string buffer /** @brief build a DeleteDMLPackage from a string buffer
* *
@ -73,20 +73,20 @@ class DeleteDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer * @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows); EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a DeleteDMLPackage from a parsed DeleteSqlStatement /** @brief build a DeleteDMLPackage from a parsed DeleteSqlStatement
* *
* @param sqlStatement the parsed DeleteSqlStatement * @param sqlStatement the parsed DeleteSqlStatement
*/ */
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement); EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer /** @brief build a InsertDMLPackage from MySQL buffer
* *
* @param colNameList, tableValuesMap * @param colNameList, tableValuesMap
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues); int rows, NullValuesBitset& nullValues) override;
protected: protected:
private: private:

View File

@ -52,27 +52,27 @@ class DMLColumn : public DMLObject
uint32_t funcScale = 0, bool isNULL = false); uint32_t funcScale = 0, bool isNULL = false);
/** @brief new ctor /** @brief new ctor
* *
*/ */
EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false, EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false, uint32_t funcScale = 0,
uint32_t funcScale = 0, bool isNULL = false); bool isNULL = false);
/** @brief dtor /** @brief dtor
*/ */
EXPORT ~DMLColumn(); EXPORT ~DMLColumn() override;
/** @brief read a DMLColumn from a ByteStream /** @brief read a DMLColumn from a ByteStream
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief write a DML column to a ByteStream /** @brief write a DML column to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief get the data for the column /** @brief get the data for the column
*/ */

View File

@ -23,13 +23,14 @@
/** @file */ /** @file */
#pragma once #pragma once
#include <utility>
#include <vector> #include <vector>
#include <string> #include <string>
#include <map> #include <map>
#include <utility> #include <utility>
#include <iostream> #include <iostream>
#include <bitset> #include <bitset>
#include <stdint.h> #include <cstdint>
#include "nullstring.h" #include "nullstring.h"
namespace dmlpackage namespace dmlpackage
@ -158,9 +159,7 @@ class SqlStatementList
public: public:
/** @brief ctor /** @brief ctor
*/ */
SqlStatementList() SqlStatementList() = default;
{
}
/** @brief dtor /** @brief dtor
*/ */
@ -218,19 +217,19 @@ class InsertSqlStatement : public SqlStatement
/** @brief dtor /** @brief dtor
*/ */
virtual ~InsertSqlStatement(); ~InsertSqlStatement() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get a string representation of the query spec /** @brief get a string representation of the query spec
*/ */
virtual std::string getQueryString() const; std::string getQueryString() const override;
/** @brief get the statement type - DML_INSERT /** @brief get the statement type - DML_INSERT
*/ */
inline virtual int getStatementType() const inline int getStatementType() const override
{ {
return DML_INSERT; return DML_INSERT;
} }
@ -259,25 +258,25 @@ class UpdateSqlStatement : public SqlStatement
* @param whereClausePtr pointer to a WhereClause object - default 0 * @param whereClausePtr pointer to a WhereClause object - default 0
*/ */
UpdateSqlStatement(TableName* tableNamePtr, ColumnAssignmentList* colAssignmentListPtr, UpdateSqlStatement(TableName* tableNamePtr, ColumnAssignmentList* colAssignmentListPtr,
WhereClause* whereClausePtr = 0); WhereClause* whereClausePtr = nullptr);
/** @brief dtor /** @brief dtor
*/ */
virtual ~UpdateSqlStatement(); ~UpdateSqlStatement() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the /** @brief get the string representation of the
* SET assignment_commalist opt_where_clause * SET assignment_commalist opt_where_clause
* statement * statement
*/ */
virtual std::string getQueryString() const; std::string getQueryString() const override;
/** @brief get the statement type - DML_UPDATE /** @brief get the statement type - DML_UPDATE
*/ */
inline virtual int getStatementType() const inline int getStatementType() const override
{ {
return DML_UPDATE; return DML_UPDATE;
} }
@ -304,23 +303,23 @@ class DeleteSqlStatement : public SqlStatement
* @param tableNamePtr pointer to a TableName object * @param tableNamePtr pointer to a TableName object
* @param whereClausePtr pointer to a WhereClause object - default = 0 * @param whereClausePtr pointer to a WhereClause object - default = 0
*/ */
DeleteSqlStatement(TableName* tableNamePtr, WhereClause* whereClausePtr = 0); explicit DeleteSqlStatement(TableName* tableNamePtr, WhereClause* whereClausePtr = nullptr);
/** @brief dtor /** @brief dtor
*/ */
virtual ~DeleteSqlStatement(); ~DeleteSqlStatement() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the WHERE clause /** @brief get the string representation of the WHERE clause
*/ */
virtual std::string getQueryString() const; std::string getQueryString() const override;
/** @brief get the statement type - DML_DELETE /** @brief get the statement type - DML_DELETE
*/ */
inline virtual int getStatementType() const inline int getStatementType() const override
{ {
return DML_DELETE; return DML_DELETE;
} }
@ -346,22 +345,22 @@ class CommandSqlStatement : public SqlStatement
* *
* @param command the COMMIT or ROLLBACK string * @param command the COMMIT or ROLLBACK string
*/ */
CommandSqlStatement(std::string command); explicit CommandSqlStatement(std::string command);
/** @brief get the statement type - DML_COMMAND /** @brief get the statement type - DML_COMMAND
*/ */
inline virtual int getStatementType() const inline int getStatementType() const override
{ {
return DML_COMMAND; return DML_COMMAND;
} }
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the COMMIT or ROLLBACK string /** @brief get the COMMIT or ROLLBACK string
*/ */
virtual std::string getQueryString() const; std::string getQueryString() const override;
std::string fCommandText; std::string fCommandText;
}; };
@ -380,7 +379,7 @@ class TableName
* *
* @param name the table name * @param name the table name
*/ */
TableName(char* name); explicit TableName(char* name);
/** @brief ctor /** @brief ctor
* *
@ -406,11 +405,10 @@ class TableName
class ColumnAssignment class ColumnAssignment
{ {
public: public:
explicit ColumnAssignment(std::string const& column, std::string const& op = "=", explicit ColumnAssignment(std::string column, std::string op = "=", std::string expr = "")
std::string const& expr = "") : fColumn(std::move(column))
: fColumn(column) , fOperator(std::move(op))
, fOperator(op) , fScalarExpression(std::move(expr))
, fScalarExpression(expr)
, fFromCol(false) , fFromCol(false)
, fFuncScale(0) , fFuncScale(0)
, fIsNull(false){}; , fIsNull(false){};
@ -449,13 +447,13 @@ class ValuesOrQuery
* *
* @param valuesPtr pointer to a ValuesList object * @param valuesPtr pointer to a ValuesList object
*/ */
ValuesOrQuery(ValuesList* valuesPtr); explicit ValuesOrQuery(ValuesList* valuesPtr);
/** @brief ctor /** @brief ctor
* *
* @param querySpecPtr pointer to a QuerySpec object * @param querySpecPtr pointer to a QuerySpec object
*/ */
ValuesOrQuery(QuerySpec* querySpecPtr); explicit ValuesOrQuery(QuerySpec* querySpecPtr);
/** @brief dtor /** @brief dtor
*/ */
@ -491,7 +489,7 @@ class SelectFilter
* *
* @param columnListPtr pointer to a ColumnNameList object * @param columnListPtr pointer to a ColumnNameList object
*/ */
SelectFilter(ColumnNameList* columnListPtr); explicit SelectFilter(ColumnNameList* columnListPtr);
/** @brief dtor /** @brief dtor
*/ */
@ -524,7 +522,7 @@ class FromClause
* *
* @param tableNameList pointer to a TableNameList object * @param tableNameList pointer to a TableNameList object
*/ */
FromClause(TableNameList* tableNameList); explicit FromClause(TableNameList* tableNameList);
/** @brief dtor /** @brief dtor
*/ */
@ -663,7 +661,7 @@ class Predicate
* *
* @param predicateType the PREDICATE_TYPE * @param predicateType the PREDICATE_TYPE
*/ */
Predicate(PREDICATE_TYPE predicateType); explicit Predicate(PREDICATE_TYPE predicateType);
/** @brief dtor /** @brief dtor
*/ */
@ -696,16 +694,16 @@ class ComparisonPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~ComparisonPredicate(); ~ComparisonPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the COMPARISON /** @brief get the string representation of the COMPARISON
* predicate * predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fLHScalarExpression; std::string fLHScalarExpression;
std::string fRHScalarExpression; std::string fRHScalarExpression;
@ -731,16 +729,16 @@ class BetweenPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~BetweenPredicate(); ~BetweenPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the BETWEEN /** @brief get the string representation of the BETWEEN
* predicate * predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fLHScalarExpression; std::string fLHScalarExpression;
std::string fRH1ScalarExpression; std::string fRH1ScalarExpression;
@ -766,16 +764,16 @@ class LikePredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~LikePredicate(); ~LikePredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the LIKE /** @brief get the string representation of the LIKE
* predicate * predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fLHScalarExpression; std::string fLHScalarExpression;
std::string fAtom; std::string fAtom;
@ -800,16 +798,16 @@ class NullTestPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~NullTestPredicate(); ~NullTestPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the NULL test /** @brief get the string representation of the NULL test
* predicate * predicate
*/ */
std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fColumnRef; std::string fColumnRef;
@ -834,16 +832,16 @@ class InPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~InPredicate(); ~InPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the IN /** @brief get the string representation of the IN
* predicate * predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fScalarExpression; std::string fScalarExpression;
std::string fOperator; std::string fOperator;
@ -867,16 +865,16 @@ class AllOrAnyPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~AllOrAnyPredicate(); ~AllOrAnyPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the /** @brief get the string representation of the
* ALL or ANY predicate * ALL or ANY predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
std::string fScalarExpression; std::string fScalarExpression;
std::string fOperator; std::string fOperator;
@ -900,16 +898,16 @@ class ExistanceTestPredicate : public Predicate
/** @brief dtor /** @brief dtor
*/ */
~ExistanceTestPredicate(); ~ExistanceTestPredicate() override;
/** @brief dump to stdout /** @brief dump to stdout
*/ */
virtual std::ostream& put(std::ostream& os) const; std::ostream& put(std::ostream& os) const override;
/** @brief get the string representation of the EXISTS /** @brief get the string representation of the EXISTS
* predicate * predicate
*/ */
virtual std::string getPredicateString() const; std::string getPredicateString() const override;
QuerySpec* fSubQuerySpecPtr; QuerySpec* fSubQuerySpecPtr;
}; };

View File

@ -44,7 +44,7 @@ class DMLTable : public DMLObject
/** @brief dtor /** @brief dtor
*/ */
~DMLTable(); ~DMLTable() override;
/** @brief get the schema name /** @brief get the schema name
*/ */
@ -85,7 +85,7 @@ class DMLTable : public DMLObject
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
int read(messageqcpp::ByteStream& bytestream); int read(messageqcpp::ByteStream& bytestream) override;
/** @brief read a DMLTable metadata from a ByteStream /** @brief read a DMLTable metadata from a ByteStream
* *
@ -103,7 +103,7 @@ class DMLTable : public DMLObject
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
int write(messageqcpp::ByteStream& bytestream); int write(messageqcpp::ByteStream& bytestream) override;
protected: protected:
private: private:

View File

@ -53,19 +53,19 @@ class InsertDMLPackage : public CalpontDMLPackage
/** @brief dtor /** @brief dtor
*/ */
EXPORT virtual ~InsertDMLPackage(); EXPORT ~InsertDMLPackage() override;
/** @brief write a InsertDMLPackage to a ByteStream /** @brief write a InsertDMLPackage to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read InsertDMLPackage from bytestream /** @brief read InsertDMLPackage from bytestream
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief read InsertDMLPackage metadata from bytestream /** @brief read InsertDMLPackage metadata from bytestream
* *
@ -85,7 +85,7 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer * @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows); EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a InsertDMLPackage from MySQL buffer /** @brief build a InsertDMLPackage from MySQL buffer
* *
@ -95,13 +95,13 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param rows number of rows to be touched * @param rows number of rows to be touched
*/ */
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues); int rows, NullValuesBitset& nullValues) override;
/** @brief build a InsertDMLPackage from a InsertSqlStatement /** @brief build a InsertDMLPackage from a InsertSqlStatement
* *
* @param sqlStmt the InsertSqlStatement * @param sqlStmt the InsertSqlStatement
*/ */
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement); EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief Dump the InsertDMLPackage for debugging purposes /** @brief Dump the InsertDMLPackage for debugging purposes
*/ */

View File

@ -45,7 +45,7 @@ class Row : public DMLObject
/** @brief dtor /** @brief dtor
*/ */
EXPORT ~Row(); EXPORT ~Row() override;
/** @brief copy constructor /** @brief copy constructor
*/ */
@ -55,13 +55,13 @@ class Row : public DMLObject
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief write a Row to a ByteStream /** @brief write a Row to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief get the list of columns in the row /** @brief get the list of columns in the row
*/ */

View File

@ -53,19 +53,19 @@ class UpdateDMLPackage : public CalpontDMLPackage
/** @brief dtor /** @brief dtor
*/ */
EXPORT virtual ~UpdateDMLPackage(); EXPORT ~UpdateDMLPackage() override;
/** @brief write a UpdateDMLPackage to a ByteStream /** @brief write a UpdateDMLPackage to a ByteStream
* *
* @param bytestream the ByteStream to write to * @param bytestream the ByteStream to write to
*/ */
EXPORT int write(messageqcpp::ByteStream& bytestream); EXPORT int write(messageqcpp::ByteStream& bytestream) override;
/** @brief read a UpdateDMLPackage from a ByteStream /** @brief read a UpdateDMLPackage from a ByteStream
* *
* @param bytestream the ByteStream to read from * @param bytestream the ByteStream to read from
*/ */
EXPORT int read(messageqcpp::ByteStream& bytestream); EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief build a UpdateDMLPackage from a string buffer /** @brief build a UpdateDMLPackage from a string buffer
* *
@ -73,13 +73,13 @@ class UpdateDMLPackage : public CalpontDMLPackage
* @param columns the number of columns in the buffer * @param columns the number of columns in the buffer
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows); EXPORT int buildFromBuffer(std::string& buffer, int columns, int rows) override;
/** @brief build a UpdateDMLPackage from a parsed UpdateSqlStatement /** @brief build a UpdateDMLPackage from a parsed UpdateSqlStatement
* *
* @param sqlStatement the parsed UpdateSqlStatement * @param sqlStatement the parsed UpdateSqlStatement
*/ */
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement); EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief build a InsertDMLPackage from MySQL buffer /** @brief build a InsertDMLPackage from MySQL buffer
* *
@ -87,7 +87,7 @@ class UpdateDMLPackage : public CalpontDMLPackage
* @param rows the number of rows in the buffer * @param rows the number of rows in the buffer
*/ */
EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, EXPORT int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns,
int rows, NullValuesBitset& nullValues); int rows, NullValuesBitset& nullValues) override;
void buildUpdateFromMysqlBuffer(UpdateSqlStatement& updateStmt); void buildUpdateFromMysqlBuffer(UpdateSqlStatement& updateStmt);
protected: protected:

View File

@ -23,10 +23,11 @@
/** @file */ /** @file */
#pragma once #pragma once
#include <string> #include <string>
#include <utility>
#include <vector> #include <vector>
#include <map> #include <map>
#include <bitset> #include <bitset>
#include <stdint.h> #include <cstdint>
#include "dmlpkg.h" #include "dmlpkg.h"
#define EXPORT #define EXPORT
@ -57,7 +58,7 @@ class VendorDMLStatement
EXPORT VendorDMLStatement(std::string dmlstatement, int stmttype, std::string tName, std::string schema, EXPORT VendorDMLStatement(std::string dmlstatement, int stmttype, std::string tName, std::string schema,
int rows, int columns, ColNameList& colNameList, TableValuesMap& tableValuesMap, int rows, int columns, ColNameList& colNameList, TableValuesMap& tableValuesMap,
NullValuesBitset& nullValues, int sessionID); NullValuesBitset& nullValues, int sessionID);
/** @brief destructor /** @brief destructor
*/ */
EXPORT ~VendorDMLStatement(); EXPORT ~VendorDMLStatement();
@ -73,7 +74,7 @@ class VendorDMLStatement
*/ */
inline void set_TableName(std::string value) inline void set_TableName(std::string value)
{ {
fTableName = value; fTableName = std::move(value);
} }
/** @brief Get the schema name /** @brief Get the schema name
@ -87,7 +88,7 @@ class VendorDMLStatement
*/ */
inline void set_SchemaName(std::string value) inline void set_SchemaName(std::string value)
{ {
fSchema = value; fSchema = std::move(value);
} }
/** @brief Get the DML statVendorDMLStatement classement type /** @brief Get the DML statVendorDMLStatement classement type
@ -115,7 +116,7 @@ class VendorDMLStatement
*/ */
inline void set_DMLStatement(std::string dmlStatement) inline void set_DMLStatement(std::string dmlStatement)
{ {
fDMLStatement = dmlStatement; fDMLStatement = std::move(dmlStatement);
} }
/** @brief Get the number of rows /** @brief Get the number of rows
@ -157,7 +158,7 @@ class VendorDMLStatement
*/ */
inline void set_DataBuffer(std::string value) inline void set_DataBuffer(std::string value)
{ {
fDataBuffer = value; fDataBuffer = std::move(value);
} }
/** @brief Get the session ID /** @brief Get the session ID
*/ */

View File

@ -21,7 +21,7 @@
#pragma once #pragma once
#include <stdint.h> #include <cstdint>
#include <boost/thread/mutex.hpp> #include <boost/thread/mutex.hpp>
#include <boost/thread/condition.hpp> #include <boost/thread/condition.hpp>
@ -48,4 +48,3 @@ class AutoincrementData
OIDNextValue fOidNextValueMap; OIDNextValue fOidNextValueMap;
boost::mutex fOIDnextvalLock; boost::mutex fOIDnextvalLock;
}; };

View File

@ -94,7 +94,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* ctor * ctor
*/ */
AggregateColumn(const uint32_t sessionID); explicit AggregateColumn(const uint32_t sessionID);
/** /**
* ctor * ctor
@ -109,9 +109,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* Destructors * Destructors
*/ */
virtual ~AggregateColumn() ~AggregateColumn() override = default;
{
}
/** /**
* Accessor Methods * Accessor Methods
@ -167,7 +165,7 @@ class AggregateColumn : public ReturnedColumn
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual AggregateColumn* clone() const override inline AggregateColumn* clone() const override
{ {
return new AggregateColumn(*this); return new AggregateColumn(*this);
} }
@ -190,14 +188,14 @@ class AggregateColumn : public ReturnedColumn
/** /**
* ASC flag * ASC flag
*/ */
inline virtual bool asc() const override inline bool asc() const override
{ {
return fAsc; return fAsc;
} }
/** /**
* ASC flag * ASC flag
*/ */
inline virtual void asc(const bool asc) override inline void asc(const bool asc) override
{ {
fAsc = asc; fAsc = asc;
} }
@ -205,7 +203,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* fData: SQL representation of this object * fData: SQL representation of this object
*/ */
virtual const std::string data() const override const std::string data() const override
{ {
return fData; return fData;
} }
@ -221,24 +219,24 @@ class AggregateColumn : public ReturnedColumn
/** /**
* Overloaded stream operator * Overloaded stream operator
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** /**
* Serialize interface * Serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
/** /**
* Serialize interface * Serialize interface
*/ */
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -253,7 +251,7 @@ class AggregateColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -309,8 +307,8 @@ class AggregateColumn : public ReturnedColumn
static AggOp agname2num(const std::string&); static AggOp agname2num(const std::string&);
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override; bool hasAggregate() override;
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
@ -357,7 +355,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
bool localIsNull = false; bool localIsNull = false;
evaluate(row, localIsNull); evaluate(row, localIsNull);
@ -368,7 +366,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getIntVal(); return TreeNode::getIntVal();
@ -377,7 +375,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getUintVal(); return TreeNode::getUintVal();
@ -386,7 +384,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getFloatVal(); return TreeNode::getFloatVal();
@ -395,7 +393,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDoubleVal(); return TreeNode::getDoubleVal();
@ -404,7 +402,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getLongDoubleVal(); return TreeNode::getLongDoubleVal();
@ -413,7 +411,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDecimalVal(); return TreeNode::getDecimalVal();
@ -421,7 +419,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDateIntVal(); return TreeNode::getDateIntVal();
@ -429,7 +427,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getTimeIntVal(); return TreeNode::getTimeIntVal();
@ -437,7 +435,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDatetimeIntVal(); return TreeNode::getDatetimeIntVal();
@ -445,7 +443,7 @@ class AggregateColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getTimestampIntVal(); return TreeNode::getTimestampIntVal();

View File

@ -51,7 +51,7 @@ class ArithmeticColumn : public ReturnedColumn
ArithmeticColumn(); ArithmeticColumn();
ArithmeticColumn(const std::string& sql, const uint32_t sessionID = 0); ArithmeticColumn(const std::string& sql, const uint32_t sessionID = 0);
ArithmeticColumn(const ArithmeticColumn& rhs, const uint32_t sessionID = 0); ArithmeticColumn(const ArithmeticColumn& rhs, const uint32_t sessionID = 0);
virtual ~ArithmeticColumn(); ~ArithmeticColumn() override;
inline ParseTree* expression() const inline ParseTree* expression() const
{ {
@ -102,7 +102,7 @@ class ArithmeticColumn : public ReturnedColumn
/** /**
* get SQL representation of this object * get SQL representation of this object
*/ */
virtual const std::string data() const override const std::string data() const override
{ {
return fData; return fData;
} }
@ -110,7 +110,7 @@ class ArithmeticColumn : public ReturnedColumn
/** /**
* set SQL representation of this object * set SQL representation of this object
*/ */
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -118,13 +118,13 @@ class ArithmeticColumn : public ReturnedColumn
/** /**
* virtual stream method * virtual stream method
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual ArithmeticColumn* clone() const override inline ArithmeticColumn* clone() const override
{ {
return new ArithmeticColumn(*this); return new ArithmeticColumn(*this);
} }
@ -132,15 +132,15 @@ class ArithmeticColumn : public ReturnedColumn
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -154,7 +154,7 @@ class ArithmeticColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -164,16 +164,16 @@ class ArithmeticColumn : public ReturnedColumn
bool operator!=(const ArithmeticColumn& t) const; bool operator!=(const ArithmeticColumn& t) const;
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override; bool hasAggregate() override;
virtual bool hasWindowFunc() override; bool hasWindowFunc() override;
virtual void setDerivedTable() override; void setDerivedTable() override;
virtual void replaceRealCol(std::vector<SRCP>&) override; void replaceRealCol(std::vector<SRCP>&) override;
virtual const std::vector<SimpleColumn*>& simpleColumnList() const override const std::vector<SimpleColumn*>& simpleColumnList() const override
{ {
return fSimpleColumnList; return fSimpleColumnList;
} }
virtual void setSimpleColumnList() override; void setSimpleColumnList() override;
/** /**
* Return the table that the column arguments belong to. * Return the table that the column arguments belong to.
@ -181,13 +181,13 @@ class ArithmeticColumn : public ReturnedColumn
* @return tablename, if all arguments belong to one table * @return tablename, if all arguments belong to one table
* empty string "", if multiple tables are involved in this func * empty string "", if multiple tables are involved in this func
*/ */
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override; bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
std::string fTableAlias; // table alias for this column std::string fTableAlias; // table alias for this column
bool fAsc = false; // asc flag for order by column bool fAsc = false; // asc flag for order by column
std::string fData; std::string fData;
/** build expression tree /** build expression tree
@ -211,62 +211,62 @@ class ArithmeticColumn : public ReturnedColumn
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
public: public:
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getStrVal(row, isNull); return fExpression->getStrVal(row, isNull);
} }
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getIntVal(row, isNull); return fExpression->getIntVal(row, isNull);
} }
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getUintVal(row, isNull); return fExpression->getUintVal(row, isNull);
} }
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getFloatVal(row, isNull); return fExpression->getFloatVal(row, isNull);
} }
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getDoubleVal(row, isNull); return fExpression->getDoubleVal(row, isNull);
} }
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getLongDoubleVal(row, isNull); return fExpression->getLongDoubleVal(row, isNull);
} }
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getDecimalVal(row, isNull); return fExpression->getDecimalVal(row, isNull);
} }
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getDateIntVal(row, isNull); return fExpression->getDateIntVal(row, isNull);
} }
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getDatetimeIntVal(row, isNull); return fExpression->getDatetimeIntVal(row, isNull);
} }
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getTimestampIntVal(row, isNull); return fExpression->getTimestampIntVal(row, isNull);
} }
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getTimeIntVal(row, isNull); return fExpression->getTimeIntVal(row, isNull);
} }
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{ {
return fExpression->getBoolVal(row, isNull); return fExpression->getBoolVal(row, isNull);
} }

View File

@ -46,16 +46,16 @@ class ArithmeticOperator : public Operator
public: public:
ArithmeticOperator(); ArithmeticOperator();
ArithmeticOperator(const std::string& operatorName); explicit ArithmeticOperator(const std::string& operatorName);
ArithmeticOperator(const ArithmeticOperator& rhs); ArithmeticOperator(const ArithmeticOperator& rhs);
virtual ~ArithmeticOperator(); ~ArithmeticOperator() override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual ArithmeticOperator* clone() const override inline ArithmeticOperator* clone() const override
{ {
return new ArithmeticOperator(*this); return new ArithmeticOperator(*this);
} }
@ -72,15 +72,15 @@ class ArithmeticOperator : public Operator
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -94,7 +94,7 @@ class ArithmeticOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -107,11 +107,11 @@ class ArithmeticOperator : public Operator
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
using Operator::evaluate; using Operator::evaluate;
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override; inline void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override;
using Operator::getStrVal; using Operator::getStrVal;
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull, ParseTree* lop,
ParseTree* rop) override ParseTree* rop) override
{ {
bool localIsNull = false; bool localIsNull = false;
evaluate(row, localIsNull, lop, rop); evaluate(row, localIsNull, lop, rop);
@ -119,38 +119,37 @@ class ArithmeticOperator : public Operator
return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone); return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone);
} }
using Operator::getIntVal; using Operator::getIntVal;
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override int64_t getIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getIntVal(); return TreeNode::getIntVal();
} }
using Operator::getUintVal; using Operator::getUintVal;
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getUintVal(); return TreeNode::getUintVal();
} }
using Operator::getFloatVal; using Operator::getFloatVal;
virtual float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override float getFloatVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getFloatVal(); return TreeNode::getFloatVal();
} }
using Operator::getDoubleVal; using Operator::getDoubleVal;
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override double getDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getDoubleVal(); return TreeNode::getDoubleVal();
} }
using Operator::getLongDoubleVal; using Operator::getLongDoubleVal;
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, long double getLongDoubleVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getLongDoubleVal(); return TreeNode::getLongDoubleVal();
} }
using Operator::getDecimalVal; using Operator::getDecimalVal;
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
@ -169,32 +168,31 @@ class ArithmeticOperator : public Operator
return TreeNode::getDecimalVal(); return TreeNode::getDecimalVal();
} }
using Operator::getDateIntVal; using Operator::getDateIntVal;
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getDateIntVal(); return TreeNode::getDateIntVal();
} }
using Operator::getDatetimeIntVal; using Operator::getDatetimeIntVal;
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getDatetimeIntVal(); return TreeNode::getDatetimeIntVal();
} }
using Operator::getTimestampIntVal; using Operator::getTimestampIntVal;
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getTimestampIntVal(); return TreeNode::getTimestampIntVal();
} }
using Operator::getTimeIntVal; using Operator::getTimeIntVal;
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getTimeIntVal(); return TreeNode::getTimeIntVal();
} }
using Operator::getBoolVal; using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
evaluate(row, isNull, lop, rop); evaluate(row, isNull, lop, rop);
return TreeNode::getBoolVal(); return TreeNode::getBoolVal();
@ -209,7 +207,7 @@ class ArithmeticOperator : public Operator
fDecimalOverflowCheck = check; fDecimalOverflowCheck = check;
} }
inline virtual std::string toCppCode(IncludeSet& includes) const override inline std::string toCppCode(IncludeSet& includes) const override
{ {
includes.insert("arithmeticoperator.h"); includes.insert("arithmeticoperator.h");
std::stringstream ss; std::stringstream ss;

View File

@ -23,6 +23,6 @@
// # of bytes in a block // # of bytes in a block
const uint64_t BLOCK_SIZE = 8192; const uint64_t BLOCK_SIZE = 8192;
// lobgical_block_rids is the # of rows 1-byter-column in a block // logical_block_rids is the # of rows 1-byter-column in a block
// its value is the same as block_size, but different unit // its value is the same as block_size, but different unit
const uint64_t LOGICAL_BLOCK_RIDS = BLOCK_SIZE; const uint64_t LOGICAL_BLOCK_RIDS = BLOCK_SIZE;

View File

@ -25,13 +25,13 @@
using namespace std; using namespace std;
#include <boost/uuid/uuid_io.hpp> #include <boost/uuid/uuid_io.hpp>
#include <utility>
#include "bytestream.h" #include "bytestream.h"
using namespace messageqcpp; using namespace messageqcpp;
#include "calpontselectexecutionplan.h" #include "calpontselectexecutionplan.h"
#include "objectreader.h" #include "objectreader.h"
#include "filter.h"
#include "returnedcolumn.h" #include "returnedcolumn.h"
#include "simplecolumn.h" #include "simplecolumn.h"
#include "querystats.h" #include "querystats.h"
@ -63,10 +63,10 @@ CalpontSelectExecutionPlan::ColumnMap CalpontSelectExecutionPlan::fColMap;
/** /**
* Constructors/Destructors * Constructors/Destructors
*/ */
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(const int location) CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(int location)
: fLocalQuery(GLOBAL_QUERY) : fLocalQuery(GLOBAL_QUERY)
, fFilters(0) , fFilters(nullptr)
, fHaving(0) , fHaving(nullptr)
, fLocation(location) , fLocation(location)
, fDependent(false) , fDependent(false)
, fTxnID(-1) , fTxnID(-1)
@ -98,17 +98,18 @@ CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(const int location)
fUuid = QueryTeleClient::genUUID(); fUuid = QueryTeleClient::genUUID();
} }
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan( CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(ReturnedColumnList returnedCols, ParseTree* filters,
const ReturnedColumnList& returnedCols, ParseTree* filters, const SelectList& subSelects, SelectList subSelects, GroupByColumnList groupByCols,
const GroupByColumnList& groupByCols, ParseTree* having, const OrderByColumnList& orderByCols, ParseTree* having, OrderByColumnList orderByCols,
const string alias, const int location, const bool dependent, const bool withRollup) string alias, int location, bool dependent,
: fReturnedCols(returnedCols) bool withRollup)
: fReturnedCols(std::move(returnedCols))
, fFilters(filters) , fFilters(filters)
, fSubSelects(subSelects) , fSubSelects(std::move(subSelects))
, fGroupByCols(groupByCols) , fGroupByCols(std::move(groupByCols))
, fHaving(having) , fHaving(having)
, fOrderByCols(orderByCols) , fOrderByCols(std::move(orderByCols))
, fTableAlias(alias) , fTableAlias(std::move(alias))
, fLocation(location) , fLocation(location)
, fDependent(dependent) , fDependent(dependent)
, fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL) , fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL)
@ -118,23 +119,18 @@ CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(
} }
CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(string data) CalpontSelectExecutionPlan::CalpontSelectExecutionPlan(string data)
: fData(data) : fData(std::move(data)), fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL), fWithRollup(false)
, fPriority(querystats::DEFAULT_USER_PRIORITY_LEVEL)
, fWithRollup(false)
{ {
fUuid = QueryTeleClient::genUUID(); fUuid = QueryTeleClient::genUUID();
} }
CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan() CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan()
{ {
if (fFilters != NULL) delete fFilters;
delete fFilters; delete fHaving;
if (fHaving != NULL) fFilters = nullptr;
delete fHaving; fHaving = nullptr;
fFilters = NULL;
fHaving = NULL;
if (!fDynamicParseTreeVec.empty()) if (!fDynamicParseTreeVec.empty())
{ {
@ -145,11 +141,11 @@ CalpontSelectExecutionPlan::~CalpontSelectExecutionPlan()
// 'delete fFilters;' above has already deleted objects pointed // 'delete fFilters;' above has already deleted objects pointed
// to by parseTree->left()/right()/data(), so we set the // to by parseTree->left()/right()/data(), so we set the
// pointers to NULL here before calling 'delete parseTree;' // pointers to NULL here before calling 'delete parseTree;'
parseTree->left((ParseTree*)(NULL)); parseTree->left((ParseTree*)(nullptr));
parseTree->right((ParseTree*)(NULL)); parseTree->right((ParseTree*)(nullptr));
parseTree->data((TreeNode*)(NULL)); parseTree->data((TreeNode*)(nullptr));
delete parseTree; delete parseTree;
parseTree = NULL; parseTree = nullptr;
} }
} }
@ -265,7 +261,7 @@ string CalpontSelectExecutionPlan::toString() const
// Filters // Filters
output << ">>Filters" << endl; output << ">>Filters" << endl;
if (filters() != 0) if (filters() != nullptr)
filters()->walk(ParseTree::print, output); filters()->walk(ParseTree::print, output);
else else
output << "empty filter tree" << endl; output << "empty filter tree" << endl;
@ -282,7 +278,7 @@ string CalpontSelectExecutionPlan::toString() const
} }
// Having // Having
if (having() != 0) if (having() != nullptr)
{ {
output << ">>Having" << endl; output << ">>Having" << endl;
having()->walk(ParseTree::print, output); having()->walk(ParseTree::print, output);
@ -496,16 +492,16 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
fDerivedTableList.clear(); fDerivedTableList.clear();
fSelectSubList.clear(); fSelectSubList.clear();
if (fFilters != 0) if (fFilters != nullptr)
{ {
delete fFilters; delete fFilters;
fFilters = 0; fFilters = nullptr;
} }
if (fHaving != 0) if (fHaving != nullptr)
{ {
delete fHaving; delete fHaving;
fHaving = 0; fHaving = nullptr;
} }
if (!fDynamicParseTreeVec.empty()) if (!fDynamicParseTreeVec.empty())
@ -517,11 +513,11 @@ void CalpontSelectExecutionPlan::unserialize(messageqcpp::ByteStream& b)
// 'delete fFilters;' above has already deleted objects pointed // 'delete fFilters;' above has already deleted objects pointed
// to by parseTree->left()/right()/data(), so we set the // to by parseTree->left()/right()/data(), so we set the
// pointers to NULL here before calling 'delete parseTree;' // pointers to NULL here before calling 'delete parseTree;'
parseTree->left((ParseTree*)(NULL)); parseTree->left((ParseTree*)(nullptr));
parseTree->right((ParseTree*)(NULL)); parseTree->right((ParseTree*)(nullptr));
parseTree->data((TreeNode*)(NULL)); parseTree->data((TreeNode*)(nullptr));
delete parseTree; delete parseTree;
parseTree = NULL; parseTree = nullptr;
} }
} }
@ -699,12 +695,12 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontSelectExecutionPlan& t)
return false; return false;
// fFilters // fFilters
if (fFilters != NULL && t.fFilters != NULL) if (fFilters != nullptr && t.fFilters != nullptr)
{ {
if (*fFilters != *t.fFilters) if (*fFilters != *t.fFilters)
return false; return false;
} }
else if (fFilters != NULL || t.fFilters != NULL) else if (fFilters != nullptr || t.fFilters != nullptr)
return false; return false;
// fSubSelects // fSubSelects
@ -725,12 +721,12 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontSelectExecutionPlan& t)
return false; return false;
// fHaving // fHaving
if (fHaving != NULL && t.fHaving != NULL) if (fHaving != nullptr && t.fHaving != nullptr)
{ {
if (*fHaving != *t.fHaving) if (*fHaving != *t.fHaving)
return false; return false;
} }
else if (fHaving != NULL || t.fHaving != NULL) else if (fHaving != nullptr || t.fHaving != nullptr)
return false; return false;
// fOrderByCols // fOrderByCols
@ -795,7 +791,7 @@ bool CalpontSelectExecutionPlan::operator==(const CalpontExecutionPlan* t) const
ac = dynamic_cast<const CalpontSelectExecutionPlan*>(t); ac = dynamic_cast<const CalpontSelectExecutionPlan*>(t);
if (ac == NULL) if (ac == nullptr)
return false; return false;
return *this == *ac; return *this == *ac;

View File

@ -146,19 +146,18 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** /**
* Constructors * Constructors
*/ */
CalpontSelectExecutionPlan(const int location = MAIN); explicit CalpontSelectExecutionPlan(int location = MAIN);
CalpontSelectExecutionPlan(const ReturnedColumnList& returnedCols, ParseTree* filters, CalpontSelectExecutionPlan(ReturnedColumnList returnedCols, ParseTree* filters, SelectList subSelects,
const SelectList& subSelects, const GroupByColumnList& groupByCols, GroupByColumnList groupByCols, ParseTree* having, OrderByColumnList orderByCols,
ParseTree* having, const OrderByColumnList& orderByCols, const std::string alias, std::string alias, int location, bool dependent, bool withRollup);
const int location, const bool dependent, const bool withRollup);
CalpontSelectExecutionPlan(const std::string data); explicit CalpontSelectExecutionPlan(std::string data);
/** /**
* Destructors * Destructors
*/ */
virtual ~CalpontSelectExecutionPlan(); ~CalpontSelectExecutionPlan() override;
/** /**
* Access and mutator methods * Access and mutator methods
@ -366,13 +365,13 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** sql representation of this select query /** sql representation of this select query
* *
*/ */
const std::string data() const const std::string& data() const
{ {
return fData; return fData;
} }
void data(const std::string data) void data(std::string data)
{ {
fData = data; fData = std::move(data);
} }
/** session id /** session id
@ -679,7 +678,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fDJSSmallSideLimit = l; fDJSSmallSideLimit = l;
} }
uint64_t djsSmallSideLimit() uint64_t djsSmallSideLimit() const
{ {
return fDJSSmallSideLimit; return fDJSSmallSideLimit;
} }
@ -688,7 +687,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fDJSLargeSideLimit = l; fDJSLargeSideLimit = l;
} }
uint64_t djsLargeSideLimit() uint64_t djsLargeSideLimit() const
{ {
return fDJSLargeSideLimit; return fDJSLargeSideLimit;
} }
@ -697,7 +696,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fDJSPartitionSize = l; fDJSPartitionSize = l;
} }
uint64_t djsPartitionSize() uint64_t djsPartitionSize() const
{ {
return fDJSPartitionSize; return fDJSPartitionSize;
} }
@ -715,7 +714,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fDJSForceRun = b; fDJSForceRun = b;
} }
bool djsForceRun() bool djsForceRun() const
{ {
return fDJSForceRun; return fDJSForceRun;
} }
@ -724,7 +723,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fMaxPmJoinResultCount = value; fMaxPmJoinResultCount = value;
} }
uint32_t maxPmJoinResultCount() uint32_t maxPmJoinResultCount() const
{ {
return fMaxPmJoinResultCount; return fMaxPmJoinResultCount;
} }
@ -733,7 +732,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fUMMemLimit = l; fUMMemLimit = l;
} }
int64_t umMemLimit() int64_t umMemLimit() const
{ {
return fUMMemLimit; return fUMMemLimit;
} }
@ -742,7 +741,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
{ {
fIsDML = b; fIsDML = b;
} }
bool isDML() bool isDML() const
{ {
return fIsDML; return fIsDML;
} }
@ -762,15 +761,15 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** /**
* @note Serialize() assumes that none of the vectors contain NULL pointers. * @note Serialize() assumes that none of the vectors contain NULL pointers.
*/ */
virtual void serialize(messageqcpp::ByteStream&) const; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&); void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const CalpontExecutionPlan* t) const; bool operator==(const CalpontExecutionPlan* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -784,7 +783,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const CalpontExecutionPlan* t) const; bool operator!=(const CalpontExecutionPlan* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -863,7 +862,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** /**
* A tree of Filter objects * A tree of Filter objects
*/ */
ParseTree* fFilters = nullptr; ParseTree* fFilters{nullptr};
/** /**
* A list of CalpontExecutionPlan objects * A list of CalpontExecutionPlan objects
*/ */
@ -875,7 +874,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
/** /**
* A tree of having clause condition associated with group by clause * A tree of having clause condition associated with group by clause
*/ */
ParseTree* fHaving; ParseTree* fHaving{nullptr};
/** /**
* A list of order by columns * A list of order by columns
*/ */
@ -955,7 +954,7 @@ class CalpontSelectExecutionPlan : public CalpontExecutionPlan
// Derived table involved in the query. For derived table optimization // Derived table involved in the query. For derived table optimization
std::vector<SCSEP> fSubSelectList; std::vector<SCSEP> fSubSelectList;
boost::uuids::uuid fUuid; boost::uuids::uuid fUuid{};
/* Disk-based join vars */ /* Disk-based join vars */
uint64_t fDJSSmallSideLimit = 0; uint64_t fDJSSmallSideLimit = 0;

View File

@ -139,9 +139,8 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
{ {
} }
DictOID(const DictOID& rhs) DictOID(const DictOID& rhs)
: dictOID(rhs.dictOID), listOID(rhs.listOID), treeOID(rhs.treeOID), compressionType(rhs.compressionType)
{ = default;
}
OID dictOID; OID dictOID;
OID listOID; OID listOID;
OID treeOID; OID treeOID;
@ -176,7 +175,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
// If we used an unorderedmap<OID, ColumnResult*>, we might improve performance. // If we used an unorderedmap<OID, ColumnResult*>, we might improve performance.
// Maybe. // Maybe.
NJLSysDataVector sysDataVec; NJLSysDataVector sysDataVec;
NJLSysDataList(){}; NJLSysDataList() = default;
~NJLSysDataList(); ~NJLSysDataList();
NJLSysDataVector::const_iterator begin() const NJLSysDataVector::const_iterator begin() const
{ {
@ -439,9 +438,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
*/ */
struct TableName struct TableName
{ {
TableName() TableName() = default;
{
}
TableName(std::string sch, std::string tb) : schema(sch), table(tb) TableName(std::string sch, std::string tb) : schema(sch), table(tb)
{ {
} }
@ -873,7 +870,7 @@ class CalpontSystemCatalog : public datatypes::SystemCatalog
private: private:
/** Constuctors */ /** Constuctors */
explicit CalpontSystemCatalog(const CalpontSystemCatalog& rhs); CalpontSystemCatalog(const CalpontSystemCatalog& rhs);
CalpontSystemCatalog& operator=(const CalpontSystemCatalog& rhs); CalpontSystemCatalog& operator=(const CalpontSystemCatalog& rhs);

View File

@ -56,7 +56,7 @@ class ClientRotator
} }
} }
/** @brief connnect /** @brief connect
* *
* Try connecting to client based on session id. If no connection, * Try connecting to client based on session id. If no connection,
* try connectList. * try connectList.
@ -79,7 +79,7 @@ class ClientRotator
{ {
fClient->shutdown(); fClient->shutdown();
delete fClient; delete fClient;
fClient = 0; fClient = nullptr;
} }
} }
@ -140,7 +140,7 @@ class ClientRotator
*/ */
bool exeConnect(const std::string& clientName); bool exeConnect(const std::string& clientName);
/** @brief connnect to list /** @brief connect to list
* *
* Try connecting to next client on list * Try connecting to next client on list
* until timeout lapses. Then throw exception. * until timeout lapses. Then throw exception.

View File

@ -67,22 +67,23 @@ class ConstantColumn : public ReturnedColumn
/** /**
* ctor * ctor
*/ */
ConstantColumn(const std::string& sql, TYPE type = LITERAL); explicit ConstantColumn(const std::string& sql, TYPE type = LITERAL);
/** /**
* ctor * ctor
*/ */
ConstantColumn(const int64_t val, TYPE type = NUM); // deprecate explicit ConstantColumn(const int64_t val, TYPE type = NUM); // deprecate
/** /**
* ctor * ctor
*/ */
ConstantColumn(const uint64_t val, TYPE type = NUM, int8_t scale = 0, uint8_t precision = 0); // deprecate explicit ConstantColumn(const uint64_t val, TYPE type = NUM, int8_t scale = 0,
uint8_t precision = 0); // deprecate
// There are more ctors below... // There are more ctors below...
/** /**
* dtor * dtor
*/ */
virtual ~ConstantColumn(); ~ConstantColumn() override;
/* /*
* Accessor Methods * Accessor Methods
@ -144,25 +145,25 @@ class ConstantColumn : public ReturnedColumn
/** /**
* accessor * accessor
*/ */
virtual const std::string data() const override; const std::string data() const override;
/** /**
* accessor * accessor
*/ */
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
/** /**
* accessor * accessor
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual ConstantColumn* clone() const override inline ConstantColumn* clone() const override
{ {
return new ConstantColumn(*this); return new ConstantColumn(*this);
} }
@ -173,18 +174,18 @@ class ConstantColumn : public ReturnedColumn
/** /**
* serialize * serialize
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
/** /**
* unserialize * unserialize
*/ */
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -198,7 +199,7 @@ class ConstantColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -207,13 +208,13 @@ class ConstantColumn : public ReturnedColumn
*/ */
bool operator!=(const ConstantColumn& t) const; bool operator!=(const ConstantColumn& t) const;
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
/** Constant column on the filte can always be moved into derived table */ /** Constant column on the filte can always be moved into derived table */
virtual void setDerivedTable() override void setDerivedTable() override
{ {
fDerivedTable = std::string("*"); fDerivedTable = std::string("*");
} }
@ -267,7 +268,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return TreeNode::getBoolVal(); return TreeNode::getBoolVal();
@ -275,7 +276,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.strVal; return fResult.strVal;
@ -283,7 +284,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.intVal; return fResult.intVal;
@ -291,7 +292,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.uintVal; return fResult.uintVal;
@ -299,7 +300,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.floatVal; return fResult.floatVal;
@ -307,7 +308,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.doubleVal; return fResult.doubleVal;
@ -315,7 +316,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
return fResult.decimalVal; return fResult.decimalVal;
@ -323,7 +324,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
@ -338,7 +339,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
@ -354,7 +355,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
@ -370,7 +371,7 @@ class ConstantColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = isNull || (fType == NULLDATA); isNull = isNull || (fType == NULLDATA);
@ -409,7 +410,7 @@ class ConstantColumnNull : public ConstantColumn
class ConstantColumnString : public ConstantColumn class ConstantColumnString : public ConstantColumn
{ {
public: public:
ConstantColumnString(const std::string& str) : ConstantColumn(str, ConstantColumn::LITERAL) explicit ConstantColumnString(const std::string& str) : ConstantColumn(str, ConstantColumn::LITERAL)
{ {
} }
}; };
@ -471,7 +472,6 @@ std::ostream& operator<<(std::ostream& output, const ConstantColumn& rhs);
class RollupMarkColumn : public ReturnedColumn class RollupMarkColumn : public ReturnedColumn
{ {
public: public:
/** /**
* ctor * ctor
*/ */
@ -483,7 +483,7 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* dtor * dtor
*/ */
virtual ~RollupMarkColumn(); ~RollupMarkColumn() override;
/** /**
* accessor * accessor
@ -502,26 +502,26 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* accessor * accessor
*/ */
virtual const std::string data() const override const std::string data() const override
{ {
return ""; return "";
} }
/** /**
* accessor * accessor
*/ */
virtual void data(const std::string data) override void data(const std::string data) override
{ {
idbassert(0); idbassert(0);
} }
/** /**
* accessor * accessor
*/ */
virtual const std::string toString() const override const std::string toString() const override
{ {
return "RollupMarkColumn"; return "RollupMarkColumn";
} }
virtual std::string toCppCode(IncludeSet& includes) const override std::string toCppCode(IncludeSet& includes) const override
{ {
idbassert(0); idbassert(0);
} }
@ -529,7 +529,7 @@ class RollupMarkColumn : public ReturnedColumn
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual RollupMarkColumn* clone() const override inline RollupMarkColumn* clone() const override
{ {
return new RollupMarkColumn(); return new RollupMarkColumn();
} }
@ -540,18 +540,18 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* serialize * serialize
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
/** /**
* unserialize * unserialize
*/ */
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override bool operator==(const TreeNode* t) const override
{ {
return false; return false;
} }
@ -571,7 +571,7 @@ class RollupMarkColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override bool operator!=(const TreeNode* t) const override
{ {
return true; return true;
} }
@ -586,13 +586,13 @@ class RollupMarkColumn : public ReturnedColumn
return false; return false;
} }
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
/** Constant column on the filte can always be moved into derived table */ /** Constant column on the filte can always be moved into derived table */
virtual void setDerivedTable() override void setDerivedTable() override
{ {
fDerivedTable = std::string("*"); fDerivedTable = std::string("*");
} }
@ -617,18 +617,18 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{ {
return true; return true;
} }
/** /**
* F&E * F&E
*/ */
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override; const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
/** /**
* F&E * F&E
*/ */
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;
return 0x12340000UL; return 0x12340000UL;
@ -636,28 +636,28 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
return getIntVal(row, isNull); return getIntVal(row, isNull);
} }
/** /**
* F&E * F&E
*/ */
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
return getIntVal(row, isNull); return getIntVal(row, isNull);
} }
/** /**
* F&E * F&E
*/ */
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
return getIntVal(row, isNull); return getIntVal(row, isNull);
} }
/** /**
* F&E * F&E
*/ */
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;
return fResult.decimalVal; return fResult.decimalVal;
@ -665,7 +665,7 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;
@ -680,7 +680,7 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;
@ -696,7 +696,7 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;
@ -712,7 +712,7 @@ class RollupMarkColumn : public ReturnedColumn
/** /**
* F&E * F&E
*/ */
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
isNull = false; isNull = false;

View File

@ -64,7 +64,7 @@ class ConstantFilter : public Filter
*/ */
ConstantFilter(); ConstantFilter();
ConstantFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs); ConstantFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs);
ConstantFilter(SimpleFilter* sf); explicit ConstantFilter(SimpleFilter* sf);
// for code generation purposes only // for code generation purposes only
ConstantFilter(const SOP& op, const FilterList& filterList, const SRCP& col, ConstantFilter(const SOP& op, const FilterList& filterList, const SRCP& col,
const std::string& functionName, const std::string& data); const std::string& functionName, const std::string& data);
@ -75,7 +75,7 @@ class ConstantFilter : public Filter
/** /**
* Destructors * Destructors
*/ */
virtual ~ConstantFilter(); ~ConstantFilter() override;
/** /**
* Accessor Methods * Accessor Methods
@ -114,20 +114,20 @@ class ConstantFilter : public Filter
} }
// virtual const std::string data() const; // virtual const std::string data() const;
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -141,7 +141,7 @@ class ConstantFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -188,17 +188,17 @@ class ConstantFilter : public Filter
FilterList fFilterList; /// vector of simple filters FilterList fFilterList; /// vector of simple filters
SRCP fCol; /// the common column SRCP fCol; /// the common column
std::string fFunctionName; /// function name std::string fFunctionName; /// function name
/*********************************************************** /***********************************************************
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
public: public:
ConstantFilter(const ConstantFilter& rhs); ConstantFilter(const ConstantFilter& rhs);
inline virtual ConstantFilter* clone() const override inline ConstantFilter* clone() const override
{ {
return new ConstantFilter(*this); return new ConstantFilter(*this);
} }
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override; inline bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
// get all simple columns involved in this column // get all simple columns involved in this column
const std::vector<SimpleColumn*>& simpleColumnList(); const std::vector<SimpleColumn*>& simpleColumnList();

View File

@ -49,9 +49,9 @@ class ExistsFilter : public Filter
* Constructors * Constructors
*/ */
ExistsFilter(); ExistsFilter();
ExistsFilter(const SCSEP& sub, const bool existsFlag = false, const bool correlated = false); explicit ExistsFilter(const SCSEP& sub, const bool existsFlag = false, const bool correlated = false);
ExistsFilter(const ExistsFilter& rhs); ExistsFilter(const ExistsFilter& rhs);
virtual ~ExistsFilter(); ~ExistsFilter() override;
/** /**
* Accessor Methods * Accessor Methods
@ -87,19 +87,19 @@ class ExistsFilter : public Filter
* Overloaded stream operator * Overloaded stream operator
*/ */
// virtual std::ostream& operator<< (std::ostream& output); // virtual std::ostream& operator<< (std::ostream& output);
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual ExistsFilter* clone() const override inline ExistsFilter* clone() const override
{ {
return new ExistsFilter(*this); return new ExistsFilter(*this);
} }
@ -109,7 +109,7 @@ class ExistsFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -123,7 +123,7 @@ class ExistsFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *

View File

@ -53,12 +53,12 @@ struct Token
TreeNode* value; TreeNode* value;
bool is_operator() const bool is_operator() const
{ {
if (value == 0) if (value == nullptr)
return false; return false;
return (typeid(*value) == typeid(Operator)); return (typeid(*value) == typeid(Operator));
} }
Token() : value(0) Token() : value(nullptr)
{ {
} }
Token(TreeNode* v) : value(v) Token(TreeNode* v) : value(v)

View File

@ -60,14 +60,14 @@ class Filter : public TreeNode
* Constructors * Constructors
*/ */
Filter(); Filter();
Filter(const std::string& sql); explicit Filter(const std::string& sql);
// not needed yet // not needed yet
// Filter(const Filter& rhs); // Filter(const Filter& rhs);
/** /**
* Destructors * Destructors
*/ */
virtual ~Filter(); ~Filter() override;
/** /**
* Accessor Methods * Accessor Methods
*/ */
@ -75,15 +75,15 @@ class Filter : public TreeNode
/** /**
* Operations * Operations
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
virtual const std::string data() const override const std::string data() const override
{ {
return fData; return fData;
} }
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -92,7 +92,7 @@ class Filter : public TreeNode
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual Filter* clone() const override inline Filter* clone() const override
{ {
return new Filter(*this); return new Filter(*this);
} }
@ -100,15 +100,15 @@ class Filter : public TreeNode
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -122,7 +122,7 @@ class Filter : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -133,9 +133,9 @@ class Filter : public TreeNode
/** @brief test if this filter can be combined with the argument filter /** @brief test if this filter can be combined with the argument filter
* This is for operation combine optimization * This is for operation combine optimization
* @param f the filter that this fiter tries to combine with * @param f the filter that this filter tries to combine with
* @param op the operator that connects the two filters. if one or both of the * @param op the operator that connects the two filters. if one or both of the
* two filters is constantFilter, need to make sure operator is consistant. * two filters is constantFilter, need to make sure operator is consistent.
* @return a filter(constantfilter) if successfully combined. otherwise * @return a filter(constantfilter) if successfully combined. otherwise
* return NULL * return NULL
* For Oracle front end. Deprecated now. * For Oracle front end. Deprecated now.

View File

@ -51,11 +51,11 @@ class FunctionColumn : public ReturnedColumn
{ {
public: public:
FunctionColumn(); FunctionColumn();
FunctionColumn(std::string& funcName); explicit FunctionColumn(std::string& funcName);
FunctionColumn(const std::string& functionName, const std::string& funcParmsInString, FunctionColumn(const std::string& functionName, const std::string& funcParmsInString,
const uint32_t sessionID = 0); const uint32_t sessionID = 0);
FunctionColumn(const FunctionColumn& rhs, const uint32_t sessionID = 0); FunctionColumn(const FunctionColumn& rhs, const uint32_t sessionID = 0);
virtual ~FunctionColumn(); ~FunctionColumn() override;
/** get function name /** get function name
* *
@ -131,19 +131,19 @@ class FunctionColumn : public ReturnedColumn
fTimeZone = timeZone; fTimeZone = timeZone;
} }
virtual const std::string data() const override; const std::string data() const override;
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
virtual const std::string toString() const override; const std::string toString() const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual FunctionColumn* clone() const override inline FunctionColumn* clone() const override
{ {
return new FunctionColumn(*this); return new FunctionColumn(*this);
} }
@ -151,20 +151,20 @@ class FunctionColumn : public ReturnedColumn
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override; bool hasAggregate() override;
virtual bool hasWindowFunc() override; bool hasWindowFunc() override;
virtual void setDerivedTable() override; void setDerivedTable() override;
virtual void replaceRealCol(std::vector<SRCP>&) override; void replaceRealCol(std::vector<SRCP>&) override;
virtual const std::vector<SimpleColumn*>& simpleColumnList() const override virtual const std::vector<SimpleColumn*>& simpleColumnList() const override
{ {
return fSimpleColumnList; return fSimpleColumnList;
} }
virtual void setSimpleColumnList() override; void setSimpleColumnList() override;
/** /**
* Return the tableAlias name of the table that the column arguments belong to. * Return the tableAlias name of the table that the column arguments belong to.
* *
@ -172,9 +172,9 @@ class FunctionColumn : public ReturnedColumn
* @return true, if all arguments belong to one table * @return true, if all arguments belong to one table
* false, if multiple tables are involved in the function * false, if multiple tables are involved in the function
*/ */
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override; bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
/** /**
@ -190,7 +190,7 @@ class FunctionColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -204,7 +204,7 @@ class FunctionColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -217,7 +217,7 @@ class FunctionColumn : public ReturnedColumn
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
public: public:
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
fResult.strVal.dropString(); fResult.strVal.dropString();
@ -228,32 +228,32 @@ class FunctionColumn : public ReturnedColumn
} }
return fResult.strVal; return fResult.strVal;
} }
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getIntVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getIntVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getUintVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getUintVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getFloatVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getFloatVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDoubleVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getDoubleVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getLongDoubleVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getLongDoubleVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
IDB_Decimal decimal = fFunctor->getDecimalVal(row, fFunctionParms, isNull, fOperationType); IDB_Decimal decimal = fFunctor->getDecimalVal(row, fFunctionParms, isNull, fOperationType);
@ -290,36 +290,37 @@ class FunctionColumn : public ReturnedColumn
if (fResultType.scale > decimal.scale) if (fResultType.scale > decimal.scale)
decimal.value *= IDB_pow[fResultType.scale - decimal.scale]; decimal.value *= IDB_pow[fResultType.scale - decimal.scale];
else else
decimal.value = (int64_t)( decimal.value =
decimal.value > 0 ? (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] + 0.5 (int64_t)(decimal.value > 0
: (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] - 0.5); ? (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] + 0.5
: (double)decimal.value / IDB_pow[decimal.scale - fResultType.scale] - 0.5);
} }
decimal.scale = fResultType.scale; decimal.scale = fResultType.scale;
decimal.precision = std::max(fResultType.precision, static_cast<int32_t>(decimal.precision)); decimal.precision = std::max(fResultType.precision, static_cast<int32_t>(decimal.precision));
return decimal; return decimal;
} }
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getBoolVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getBoolVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDateIntVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getDateIntVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getDatetimeIntVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getDatetimeIntVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getTimestampIntVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getTimestampIntVal(row, fFunctionParms, isNull, fOperationType);
} }
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
fOperationType.setTimeZone(fTimeZone); fOperationType.setTimeZone(fTimeZone);
return fFunctor->getTimeIntVal(row, fFunctionParms, isNull, fOperationType); return fFunctor->getTimeIntVal(row, fFunctionParms, isNull, fOperationType);
@ -332,8 +333,8 @@ class FunctionColumn : public ReturnedColumn
private: private:
funcexp::FunctionParm fFunctionParms; funcexp::FunctionParm fFunctionParms;
funcexp::Func* fFunctor; /// functor to execute this function funcexp::Func* fFunctor; /// functor to execute this function
funcexp::Func* fDynamicFunctor = NULL; // for rand encode decode funcexp::Func* fDynamicFunctor = nullptr; // for rand encode decode
bool fFixed = false; bool fFixed = false;
}; };

View File

@ -52,25 +52,25 @@ class GroupConcatColumn : public AggregateColumn
*/ */
GroupConcatColumn(); GroupConcatColumn();
GroupConcatColumn(const uint32_t sessionID); explicit GroupConcatColumn(const uint32_t sessionID);
GroupConcatColumn(const GroupConcatColumn& rhs, const uint32_t sessionID = 0); GroupConcatColumn(const GroupConcatColumn& rhs, const uint32_t sessionID = 0);
/** /**
* Destructors * Destructors
*/ */
virtual ~GroupConcatColumn(); ~GroupConcatColumn() override;
/** /**
* Overloaded stream operator * Overloaded stream operator
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
virtual GroupConcatColumn* clone() const override GroupConcatColumn* clone() const override
{ {
return new GroupConcatColumn(*this); return new GroupConcatColumn(*this);
} }
@ -98,8 +98,8 @@ class GroupConcatColumn : public AggregateColumn
/** /**
* Serialize interface * Serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -107,7 +107,7 @@ class GroupConcatColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this; * @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise * false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -124,7 +124,7 @@ class GroupConcatColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this; * @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise * true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -135,7 +135,7 @@ class GroupConcatColumn : public AggregateColumn
using AggregateColumn::operator!=; using AggregateColumn::operator!=;
virtual bool operator!=(const GroupConcatColumn& t) const; virtual bool operator!=(const GroupConcatColumn& t) const;
virtual string toCppCode(IncludeSet& includes) const override; string toCppCode(IncludeSet& includes) const override;
private: private:
std::vector<SRCP> fOrderCols; std::vector<SRCP> fOrderCols;

View File

@ -79,9 +79,7 @@ class IntervalColumn : public ReturnedColumn
IntervalColumn(); IntervalColumn();
IntervalColumn(SRCP&, int); IntervalColumn(SRCP&, int);
IntervalColumn(const IntervalColumn& rhs, const uint32_t sessionID = 0); IntervalColumn(const IntervalColumn& rhs, const uint32_t sessionID = 0);
virtual ~IntervalColumn() ~IntervalColumn() override = default;
{
}
const SRCP& val() const const SRCP& val() const
{ {
return fVal; return fVal;
@ -99,22 +97,22 @@ class IntervalColumn : public ReturnedColumn
fIntervalType = intervalType; fIntervalType = intervalType;
} }
const std::string toString() const override; const std::string toString() const override;
inline virtual IntervalColumn* clone() const override inline IntervalColumn* clone() const override
{ {
return new IntervalColumn(*this); return new IntervalColumn(*this);
} }
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override bool hasAggregate() override
{ {
return false; return false;
} }
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
/** /**
@ -124,12 +122,12 @@ class IntervalColumn : public ReturnedColumn
int fIntervalType; int fIntervalType;
// okay to be private for now. // okay to be private for now.
virtual bool operator==(const TreeNode* t) const override bool operator==(const TreeNode* t) const override
{ {
return false; return false;
} }
bool operator==(const IntervalColumn& t) const; bool operator==(const IntervalColumn& t) const;
virtual bool operator!=(const TreeNode* t) const override bool operator!=(const TreeNode* t) const override
{ {
return false; return false;
} }

View File

@ -47,25 +47,25 @@ class JsonArrayAggColumn : public AggregateColumn
*/ */
JsonArrayAggColumn(); JsonArrayAggColumn();
JsonArrayAggColumn(const uint32_t sessionID); explicit JsonArrayAggColumn(const uint32_t sessionID);
JsonArrayAggColumn(const JsonArrayAggColumn& rhs, const uint32_t sessionID = 0); JsonArrayAggColumn(const JsonArrayAggColumn& rhs, const uint32_t sessionID = 0);
/** /**
* Destructors * Destructors
*/ */
virtual ~JsonArrayAggColumn(); ~JsonArrayAggColumn() override;
/** /**
* Overloaded stream operator * Overloaded stream operator
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
virtual JsonArrayAggColumn* clone() const override JsonArrayAggColumn* clone() const override
{ {
return new JsonArrayAggColumn(*this); return new JsonArrayAggColumn(*this);
} }
@ -93,8 +93,8 @@ class JsonArrayAggColumn : public AggregateColumn
/** /**
* Serialize interface * Serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -102,7 +102,7 @@ class JsonArrayAggColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this; * @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise * false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -119,7 +119,7 @@ class JsonArrayAggColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this; * @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise * true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -130,7 +130,7 @@ class JsonArrayAggColumn : public AggregateColumn
using AggregateColumn::operator!=; using AggregateColumn::operator!=;
virtual bool operator!=(const JsonArrayAggColumn& t) const; virtual bool operator!=(const JsonArrayAggColumn& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
std::vector<SRCP> fOrderCols; std::vector<SRCP> fOrderCols;

View File

@ -27,7 +27,7 @@
#include <iosfwd> #include <iosfwd>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
//#include "expressionparser.h" // #include "expressionparser.h"
#include "operator.h" #include "operator.h"
#include "parsetree.h" #include "parsetree.h"
@ -64,13 +64,13 @@ class LogicOperator : public Operator
* Constructors * Constructors
*/ */
LogicOperator(); LogicOperator();
LogicOperator(const std::string& operatorName); explicit LogicOperator(const std::string& operatorName);
LogicOperator(const LogicOperator& rhs); LogicOperator(const LogicOperator& rhs);
/** /**
* Destructors * Destructors
*/ */
virtual ~LogicOperator(); ~LogicOperator() override;
/** /**
* Accessor Methods * Accessor Methods
@ -80,7 +80,7 @@ class LogicOperator : public Operator
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual LogicOperator* clone() const override inline LogicOperator* clone() const override
{ {
return new LogicOperator(*this); return new LogicOperator(*this);
} }
@ -88,15 +88,15 @@ class LogicOperator : public Operator
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -110,7 +110,7 @@ class LogicOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -123,7 +123,7 @@ class LogicOperator : public Operator
// F&E framework // F&E framework
using Operator::getBoolVal; using Operator::getBoolVal;
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override inline bool getBoolVal(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
switch (fOp) switch (fOp)
{ {
@ -165,12 +165,12 @@ class LogicOperator : public Operator
} }
using TreeNode::evaluate; using TreeNode::evaluate;
inline virtual void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override inline void evaluate(rowgroup::Row& row, bool& isNull, ParseTree* lop, ParseTree* rop) override
{ {
fResult.boolVal = getBoolVal(row, isNull, lop, rop); fResult.boolVal = getBoolVal(row, isNull, lop, rop);
} }
inline virtual std::string toCppCode(IncludeSet& includes) const override inline std::string toCppCode(IncludeSet& includes) const override
{ {
includes.insert("logicoperator.h"); includes.insert("logicoperator.h");
std::stringstream ss; std::stringstream ss;

View File

@ -54,7 +54,7 @@ class MCSAnalyzeTableExecutionPlan : public CalpontExecutionPlan
{ {
} }
virtual ~MCSAnalyzeTableExecutionPlan() = default; ~MCSAnalyzeTableExecutionPlan() override = default;
const ReturnedColumnList& returnedCols() const const ReturnedColumnList& returnedCols() const
{ {
@ -232,16 +232,16 @@ class MCSAnalyzeTableExecutionPlan : public CalpontExecutionPlan
return ((fSessionID & 0x80000000) != 0); return ((fSessionID & 0x80000000) != 0);
} }
virtual void serialize(messageqcpp::ByteStream& bs) const; void serialize(messageqcpp::ByteStream& bs) const override;
virtual void unserialize(messageqcpp::ByteStream& bs); void unserialize(messageqcpp::ByteStream& bs) override;
// TODO: Why do we need this? // TODO: Why do we need this?
virtual bool operator==(const CalpontExecutionPlan* t) const bool operator==(const CalpontExecutionPlan* t) const override
{ {
return false; return false;
} }
virtual bool operator!=(const CalpontExecutionPlan* t) const bool operator!=(const CalpontExecutionPlan* t) const override
{ {
return false; return false;
} }

View File

@ -28,7 +28,7 @@
#include <exception> #include <exception>
#include <string> #include <string>
#include <stdint.h> #include <cstdint>
namespace messageqcpp namespace messageqcpp
{ {
@ -53,9 +53,9 @@ class ObjectReader
class UnserializeException : public std::exception class UnserializeException : public std::exception
{ {
public: public:
UnserializeException(std::string) throw(); explicit UnserializeException(std::string) noexcept;
virtual ~UnserializeException() throw(); ~UnserializeException() noexcept override;
virtual const char* what() const throw(); const char* what() const noexcept override;
private: private:
std::string fWhat; std::string fWhat;

View File

@ -70,23 +70,23 @@ class Operator : public TreeNode
{ {
public: public:
Operator(); Operator();
Operator(const std::string& operatorName); explicit Operator(const std::string& operatorName);
Operator(const Operator& rhs); Operator(const Operator& rhs);
virtual ~Operator(); ~Operator() override;
virtual const std::string toString() const override; const std::string toString() const override;
virtual const std::string data() const override const std::string data() const override
{ {
return fData; return fData;
} }
virtual void data(const std::string data) override; void data(const std::string data) override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual Operator* clone() const override inline Operator* clone() const override
{ {
return new Operator(*this); return new Operator(*this);
} }
@ -101,15 +101,15 @@ class Operator : public TreeNode
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -123,7 +123,7 @@ class Operator : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -139,7 +139,7 @@ class Operator : public TreeNode
*/ */
virtual void reverseOp(); virtual void reverseOp();
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
protected: protected:
std::string fData; std::string fData;
@ -231,11 +231,11 @@ class Operator : public TreeNode
virtual void setOpType(Type& l, Type& r) virtual void setOpType(Type& l, Type& r)
{ {
} }
virtual void operationType(const Type& ot) override void operationType(const Type& ot) override
{ {
fOperationType = ot; fOperationType = ot;
} }
virtual const Type& operationType() const override const Type& operationType() const override
{ {
return fOperationType; return fOperationType;
} }

View File

@ -49,9 +49,9 @@ class OuterJoinOnFilter : public Filter
* Constructors * Constructors
*/ */
OuterJoinOnFilter(); OuterJoinOnFilter();
OuterJoinOnFilter(const SPTP& pt); explicit OuterJoinOnFilter(const SPTP& pt);
OuterJoinOnFilter(const OuterJoinOnFilter& rhs); OuterJoinOnFilter(const OuterJoinOnFilter& rhs);
virtual ~OuterJoinOnFilter(); ~OuterJoinOnFilter() override;
/** /**
* Accessor Methods * Accessor Methods
@ -69,19 +69,19 @@ class OuterJoinOnFilter : public Filter
* Overloaded stream operator * Overloaded stream operator
*/ */
// virtual std::ostream& operator<< (std::ostream& output); // virtual std::ostream& operator<< (std::ostream& output);
virtual const std::string toString() const override; const std::string toString() const override;
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual OuterJoinOnFilter* clone() const override inline OuterJoinOnFilter* clone() const override
{ {
return new OuterJoinOnFilter(*this); return new OuterJoinOnFilter(*this);
} }
@ -91,7 +91,7 @@ class OuterJoinOnFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -105,7 +105,7 @@ class OuterJoinOnFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -113,7 +113,8 @@ class OuterJoinOnFilter : public Filter
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
bool operator!=(const OuterJoinOnFilter& t) const; bool operator!=(const OuterJoinOnFilter& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
// default okay? // default okay?
// OuterJoinOnFilter& operator=(const OuterJoinOnFilter& rhs); // OuterJoinOnFilter& operator=(const OuterJoinOnFilter& rhs);

View File

@ -59,7 +59,7 @@ class ParseTree
* Constructor / Destructor * Constructor / Destructor
*/ */
inline ParseTree(); inline ParseTree();
inline ParseTree(TreeNode* data); inline explicit ParseTree(TreeNode* data);
inline ParseTree(TreeNode* data, ParseTree* left, ParseTree* right); inline ParseTree(TreeNode* data, ParseTree* left, ParseTree* right);
inline ParseTree(const ParseTree& rhs); inline ParseTree(const ParseTree& rhs);
inline virtual ~ParseTree(); inline virtual ~ParseTree();
@ -210,9 +210,9 @@ class ParseTree
inline static void deleter(ParseTree*& n) inline static void deleter(ParseTree*& n)
{ {
delete n->fData; delete n->fData;
n->fData = 0; n->fData = nullptr;
delete n; delete n;
n = 0; n = nullptr;
} }
inline void derivedTable(const std::string& derivedTable) inline void derivedTable(const std::string& derivedTable)
@ -238,7 +238,7 @@ class ParseTree
{ {
ParseTree* node; ParseTree* node;
GoTo direction; GoTo direction;
StackFrame(ParseTree* node_, GoTo direction_ = GoTo::Left) : node(node_), direction(direction_) explicit StackFrame(ParseTree* node_, GoTo direction_ = GoTo::Left) : node(node_), direction(direction_)
{ {
} }
}; };
@ -370,11 +370,11 @@ namespace execplan
/** /**
* Class Definition * Class Definition
*/ */
inline ParseTree::ParseTree() : fData(0), fLeft(0), fRight(0), fDerivedTable("") inline ParseTree::ParseTree() : fData(nullptr), fLeft(nullptr), fRight(nullptr), fDerivedTable("")
{ {
} }
inline ParseTree::ParseTree(TreeNode* data) : fData(data), fLeft(0), fRight(0) inline ParseTree::ParseTree(TreeNode* data) : fData(data), fLeft(nullptr), fRight(nullptr)
{ {
// bug5984. Need to validate data to be not null // bug5984. Need to validate data to be not null
if (data) if (data)
@ -389,7 +389,7 @@ inline ParseTree::ParseTree(TreeNode* data, ParseTree* left, ParseTree* right)
} }
inline ParseTree::ParseTree(const ParseTree& rhs) inline ParseTree::ParseTree(const ParseTree& rhs)
: fData(0), fLeft(0), fRight(0), fDerivedTable(rhs.fDerivedTable) : fData(nullptr), fLeft(nullptr), fRight(nullptr), fDerivedTable(rhs.fDerivedTable)
{ {
copyTree(rhs); copyTree(rhs);
} }
@ -613,22 +613,22 @@ inline ParseTree& ParseTree::operator=(const ParseTree& rhs)
inline void ParseTree::copyTree(const ParseTree& src) inline void ParseTree::copyTree(const ParseTree& src)
{ {
if (fLeft != NULL) if (fLeft != nullptr)
delete fLeft; delete fLeft;
if (fRight != NULL) if (fRight != nullptr)
delete fRight; delete fRight;
fLeft = NULL; fLeft = nullptr;
fRight = NULL; fRight = nullptr;
if (src.left() != NULL) if (src.left() != nullptr)
{ {
fLeft = new ParseTree(); fLeft = new ParseTree();
fLeft->copyTree(*(src.left())); fLeft->copyTree(*(src.left()));
} }
if (src.right() != NULL) if (src.right() != nullptr)
{ {
fRight = new ParseTree(); fRight = new ParseTree();
fRight->copyTree(*(src.right())); fRight->copyTree(*(src.right()));
@ -636,29 +636,29 @@ inline void ParseTree::copyTree(const ParseTree& src)
delete fData; delete fData;
if (src.data() == NULL) if (src.data() == nullptr)
fData = NULL; fData = nullptr;
else else
fData = src.data()->clone(); fData = src.data()->clone();
} }
inline void ParseTree::destroyTree(ParseTree* root) inline void ParseTree::destroyTree(ParseTree* root)
{ {
if (root == NULL) if (root == nullptr)
return; return;
if (root->left() != NULL) if (root->left() != nullptr)
{ {
destroyTree(root->fLeft); destroyTree(root->fLeft);
} }
if (root->right() != NULL) if (root->right() != nullptr)
{ {
destroyTree(root->fRight); destroyTree(root->fRight);
} }
delete root; delete root;
root = 0; root = nullptr;
} }
inline void ParseTree::draw(const ParseTree* n, std::ostream& dotFile) inline void ParseTree::draw(const ParseTree* n, std::ostream& dotFile)
@ -668,13 +668,11 @@ inline void ParseTree::draw(const ParseTree* n, std::ostream& dotFile)
l = n->left(); l = n->left();
r = n->right(); r = n->right();
if (l != 0) if (l != nullptr)
dotFile << "n" << (void*)n << " -> " dotFile << "n" << (void*)n << " -> " << "n" << (void*)l << std::endl;
<< "n" << (void*)l << std::endl;
if (r != 0) if (r != nullptr)
dotFile << "n" << (void*)n << " -> " dotFile << "n" << (void*)n << " -> " << "n" << (void*)r << std::endl;
<< "n" << (void*)r << std::endl;
auto& node = *(n->data()); auto& node = *(n->data());
dotFile << "n" << (void*)n << " [label=\"" << n->data()->data() << " (" << n << ") " dotFile << "n" << (void*)n << " [label=\"" << n->data()->data() << " (" << n << ") "

View File

@ -27,7 +27,7 @@
#include <string> #include <string>
#include <sstream> #include <sstream>
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
#include <cstdlib> #include <cstdlib>
#else #else
#include <alloca.h> #include <alloca.h>
@ -52,15 +52,15 @@ class PredicateOperator : public Operator
{ {
public: public:
PredicateOperator(); PredicateOperator();
PredicateOperator(const std::string& operatorName); explicit PredicateOperator(const std::string& operatorName);
PredicateOperator(const PredicateOperator& rhs); PredicateOperator(const PredicateOperator& rhs);
virtual ~PredicateOperator(); ~PredicateOperator() override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual PredicateOperator* clone() const override inline PredicateOperator* clone() const override
{ {
return new PredicateOperator(*this); return new PredicateOperator(*this);
} }
@ -68,15 +68,15 @@ class PredicateOperator : public Operator
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -90,7 +90,7 @@ class PredicateOperator : public Operator
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -107,10 +107,10 @@ class PredicateOperator : public Operator
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
using Operator::getBoolVal; using Operator::getBoolVal;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop) override; bool getBoolVal(rowgroup::Row& row, bool& isNull, ReturnedColumn* lop, ReturnedColumn* rop) override;
void setOpType(Type& l, Type& r) override; void setOpType(Type& l, Type& r) override;
inline virtual std::string toCppCode(IncludeSet& includes) const override inline std::string toCppCode(IncludeSet& includes) const override
{ {
includes.insert("predicateoperator.h"); includes.insert("predicateoperator.h");
std::stringstream ss; std::stringstream ss;

View File

@ -62,7 +62,7 @@ class PseudoColumn : public SimpleColumn
* Constructors * Constructors
*/ */
PseudoColumn(); PseudoColumn();
PseudoColumn(const uint32_t pseudoType); explicit PseudoColumn(const uint32_t pseudoType);
PseudoColumn(const std::string& token, const uint32_t pseudoType, const uint32_t sessionID = 0); PseudoColumn(const std::string& token, const uint32_t pseudoType, const uint32_t sessionID = 0);
PseudoColumn(const std::string& schema, const std::string& table, const std::string& col, PseudoColumn(const std::string& schema, const std::string& table, const std::string& col,
const uint32_t pseudoType, const uint32_t sessionID = 0); const uint32_t pseudoType, const uint32_t sessionID = 0);
@ -74,13 +74,13 @@ class PseudoColumn : public SimpleColumn
/** /**
* Destructor * Destructor
*/ */
virtual ~PseudoColumn(); ~PseudoColumn() override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual PseudoColumn* clone() const override inline PseudoColumn* clone() const override
{ {
return new PseudoColumn(*this); return new PseudoColumn(*this);
} }
@ -106,17 +106,17 @@ class PseudoColumn : public SimpleColumn
/** /**
* The serialize interface * The serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override; const std::string toString() const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -130,7 +130,7 @@ class PseudoColumn : public SimpleColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -141,7 +141,7 @@ class PseudoColumn : public SimpleColumn
static uint32_t pseudoNameToType(std::string& name); static uint32_t pseudoNameToType(std::string& name);
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
/** /**

View File

@ -83,20 +83,20 @@ class ReturnedColumn : public TreeNode
* Constructors * Constructors
*/ */
ReturnedColumn(); ReturnedColumn();
ReturnedColumn(const std::string& sql); explicit ReturnedColumn(const std::string& sql);
ReturnedColumn(const uint32_t sessionID, const bool returnAll = false); explicit ReturnedColumn(const uint32_t sessionID, const bool returnAll = false);
ReturnedColumn(const ReturnedColumn& rhs, const uint32_t sessionID = 0); ReturnedColumn(const ReturnedColumn& rhs, const uint32_t sessionID = 0);
/** /**
* Destructors * Destructors
*/ */
virtual ~ReturnedColumn(); ~ReturnedColumn() override;
/** /**
* Accessor Methods * Accessor Methods
*/ */
virtual const std::string data() const override; const std::string data() const override;
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -231,22 +231,22 @@ class ReturnedColumn : public TreeNode
/** /**
* Operations * Operations
*/ */
virtual ReturnedColumn* clone() const override = 0; ReturnedColumn* clone() const override = 0;
/** /**
* The serialize interface * The serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -261,7 +261,7 @@ class ReturnedColumn : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *

View File

@ -56,13 +56,13 @@ class RowColumn : public ReturnedColumn
/** /**
* Constructors * Constructors
*/ */
RowColumn(const uint32_t sessionID = 0); explicit RowColumn(const uint32_t sessionID = 0);
RowColumn(const RowColumn& rhs, const uint32_t sessionID = 0); RowColumn(const RowColumn& rhs, const uint32_t sessionID = 0);
RowColumn(const std::vector<SRCP>& columnVec, const uint32_t sessionID = 0); explicit RowColumn(const std::vector<SRCP>& columnVec, const uint32_t sessionID = 0);
/** /**
* Destructor * Destructor
*/ */
virtual ~RowColumn(); ~RowColumn() override;
/** /**
* Accessor Methods * Accessor Methods
@ -80,7 +80,7 @@ class RowColumn : public ReturnedColumn
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual RowColumn* clone() const override inline RowColumn* clone() const override
{ {
return new RowColumn(*this); return new RowColumn(*this);
} }
@ -95,20 +95,20 @@ class RowColumn : public ReturnedColumn
// virtual void serialize(messageqcpp::ByteStream&) const; // virtual void serialize(messageqcpp::ByteStream&) const;
// virtual void unserialize(messageqcpp::ByteStream&); // virtual void unserialize(messageqcpp::ByteStream&);
virtual const std::string toString() const override; const std::string toString() const override;
/** /**
* Serialization interface * Serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -122,7 +122,7 @@ class RowColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -131,16 +131,16 @@ class RowColumn : public ReturnedColumn
*/ */
bool operator!=(const RowColumn& t) const; bool operator!=(const RowColumn& t) const;
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override bool hasAggregate() override
{ {
return false; return false;
} }
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
/** /**
@ -156,23 +156,21 @@ class SubSelect : public ReturnedColumn
SubSelect() : ReturnedColumn() SubSelect() : ReturnedColumn()
{ {
} }
~SubSelect() ~SubSelect() override = default;
{
}
SubSelect* clone() const override SubSelect* clone() const override
{ {
return new SubSelect(); return new SubSelect();
} }
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override bool hasAggregate() override
{ {
return false; return false;
} }
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
virtual const std::string toString() const override; const std::string toString() const override;
}; };
/** /**

View File

@ -63,7 +63,7 @@ class SelectFilter : public Filter
/** /**
* Destructors * Destructors
*/ */
virtual ~SelectFilter(); ~SelectFilter() override;
/** /**
* Accessor Methods * Accessor Methods
@ -107,13 +107,13 @@ class SelectFilter : public Filter
fCorrelated = correlated; fCorrelated = correlated;
} }
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
virtual inline const std::string data() const override inline const std::string data() const override
{ {
return fData; return fData;
} }
virtual inline void data(const std::string data) override inline void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -130,14 +130,14 @@ class SelectFilter : public Filter
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual SelectFilter* clone() const override inline SelectFilter* clone() const override
{ {
return new SelectFilter(*this); return new SelectFilter(*this);
} }
@ -147,7 +147,7 @@ class SelectFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -161,7 +161,7 @@ class SelectFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *

View File

@ -67,7 +67,7 @@ namespace execplan
* immediately, causing all subsequent references to fail. This only affects * immediately, causing all subsequent references to fail. This only affects
* 'leakcheck'. * 'leakcheck'.
*/ */
//#define DESTROYSHMSEG // #define DESTROYSHMSEG
class SessionManager class SessionManager
{ {
@ -94,7 +94,7 @@ class SessionManager
* and no operation other than reset() should be performed on a * and no operation other than reset() should be performed on a
* SessionManager instantiated with this. * SessionManager instantiated with this.
*/ */
SessionManager(bool nolock); explicit SessionManager(bool nolock);
/** @brief Destructor /** @brief Destructor
* *
@ -211,4 +211,3 @@ class SessionManager
}; };
} // namespace execplan } // namespace execplan

View File

@ -36,7 +36,7 @@
#include "shmkeys.h" #include "shmkeys.h"
#include "brmtypes.h" #include "brmtypes.h"
//#define SM_DEBUG // #define SM_DEBUG
namespace execplan namespace execplan
{ {
@ -132,7 +132,7 @@ class SessionMonitor
{ {
txnCount = 0; txnCount = 0;
verID = 0; verID = 0;
activeTxns = NULL; activeTxns = nullptr;
}; };
}; };
typedef struct SessionMonitorData_struct SessionMonitorData_t; typedef struct SessionMonitorData_struct SessionMonitorData_t;

View File

@ -57,13 +57,15 @@ class SimpleColumn : public ReturnedColumn
/** /**
* Constructors * Constructors
*/ */
class ForTestPurposeWithoutOID{}; class ForTestPurposeWithoutOID
{
};
SimpleColumn(); SimpleColumn();
SimpleColumn(const std::string& token, ForTestPurposeWithoutOID); SimpleColumn(const std::string& token, ForTestPurposeWithoutOID);
SimpleColumn(const std::string& token, const uint32_t sessionID = 0); explicit SimpleColumn(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn(const std::string& schema, const std::string& table, const std::string& col, SimpleColumn(const std::string& schema, const std::string& table, const std::string& col,
const uint32_t sessionID = 0, const int lower_case_table_names = 0); const uint32_t sessionID = 0, const int lower_case_table_names = 0);
@ -75,7 +77,7 @@ class SimpleColumn : public ReturnedColumn
/** /**
* Destructor * Destructor
*/ */
virtual ~SimpleColumn(); ~SimpleColumn() override;
/** /**
* Accessor Methods * Accessor Methods
@ -124,8 +126,8 @@ class SimpleColumn : public ReturnedColumn
fOid = oid; fOid = oid;
} }
virtual const std::string data() const override; const std::string data() const override;
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -179,7 +181,7 @@ class SimpleColumn : public ReturnedColumn
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual SimpleColumn* clone() const override inline SimpleColumn* clone() const override
{ {
return new SimpleColumn(*this); return new SimpleColumn(*this);
} }
@ -191,17 +193,17 @@ class SimpleColumn : public ReturnedColumn
/** /**
* The serialize interface * The serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
virtual const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -217,7 +219,7 @@ class SimpleColumn : public ReturnedColumn
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -227,7 +229,7 @@ class SimpleColumn : public ReturnedColumn
bool operator!=(const SimpleColumn& t) const; bool operator!=(const SimpleColumn& t) const;
/** @brief check if this column is the same as the argument */ /** @brief check if this column is the same as the argument */
virtual bool sameColumn(const ReturnedColumn* rc) const override; bool sameColumn(const ReturnedColumn* rc) const override;
/** @brief return column type of this column (could be of any engine type) */ /** @brief return column type of this column (could be of any engine type) */
const CalpontSystemCatalog::ColType& colType() const const CalpontSystemCatalog::ColType& colType() const
@ -238,7 +240,7 @@ class SimpleColumn : public ReturnedColumn
/** @brief set the column's OID from the syscat */ /** @brief set the column's OID from the syscat */
void setOID(); void setOID();
virtual bool hasWindowFunc() override bool hasWindowFunc() override
{ {
return false; return false;
} }
@ -252,7 +254,7 @@ class SimpleColumn : public ReturnedColumn
* @return true, if all arguments belong to one table * @return true, if all arguments belong to one table
* false, if multiple tables are involved in the function * false, if multiple tables are involved in the function
*/ */
virtual bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override; bool singleTable(CalpontSystemCatalog::TableAliasName& tan) override;
protected: protected:
/** /**
@ -282,13 +284,13 @@ class SimpleColumn : public ReturnedColumn
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
public: public:
virtual void evaluate(rowgroup::Row& row, bool& isNull) override; void evaluate(rowgroup::Row& row, bool& isNull) override;
virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override bool getBoolVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getBoolVal(); return TreeNode::getBoolVal();
} }
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
bool localIsNull = false; bool localIsNull = false;
evaluate(row, localIsNull); evaluate(row, localIsNull);
@ -301,37 +303,37 @@ class SimpleColumn : public ReturnedColumn
return TreeNode::getStrVal(fTimeZone); return TreeNode::getStrVal(fTimeZone);
} }
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getIntVal(); return TreeNode::getIntVal();
} }
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getUintVal(); return TreeNode::getUintVal();
} }
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getFloatVal(); return TreeNode::getFloatVal();
} }
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDoubleVal(); return TreeNode::getDoubleVal();
} }
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getLongDoubleVal(); return TreeNode::getLongDoubleVal();
} }
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);

View File

@ -54,35 +54,33 @@ class SimpleColumn_Decimal : public SimpleColumn
public: public:
/** Constructors */ /** Constructors */
SimpleColumn_Decimal(); SimpleColumn_Decimal();
SimpleColumn_Decimal(const std::string& token, const uint32_t sessionID = 0); explicit SimpleColumn_Decimal(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_Decimal(const std::string& schema, const std::string& table, const std::string& col, SimpleColumn_Decimal(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0); const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_Decimal(const SimpleColumn& rhs, const uint32_t sessionID = 0); explicit SimpleColumn_Decimal(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */ /** Destructor */
virtual ~SimpleColumn_Decimal() ~SimpleColumn_Decimal() override = default;
{
}
inline virtual SimpleColumn_Decimal* clone() const override inline SimpleColumn_Decimal* clone() const override
{ {
return new SimpleColumn_Decimal<len>(*this); return new SimpleColumn_Decimal<len>(*this);
} }
/** Evaluate methods */ /** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override; inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override; inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override; inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override; inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override; inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override; inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */ /** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal; uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
void setNullVal(); void setNullVal();

View File

@ -53,36 +53,34 @@ class SimpleColumn_INT : public SimpleColumn
public: public:
/** Constructors */ /** Constructors */
SimpleColumn_INT(); SimpleColumn_INT();
SimpleColumn_INT(const std::string& token, const uint32_t sessionID = 0); explicit SimpleColumn_INT(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_INT(const std::string& schema, const std::string& table, const std::string& col, SimpleColumn_INT(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0); const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_INT(const SimpleColumn& rhs, const uint32_t sessionID = 0); explicit SimpleColumn_INT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */ /** Destructor */
virtual ~SimpleColumn_INT() ~SimpleColumn_INT() override = default;
{
}
inline virtual SimpleColumn_INT* clone() const override inline SimpleColumn_INT* clone() const override
{ {
return new SimpleColumn_INT<len>(*this); return new SimpleColumn_INT<len>(*this);
} }
/** Evaluate methods */ /** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override; inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override; inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override; inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override; inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override; inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override; inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override; inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */ /** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal; uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
void setNullVal(); void setNullVal();
@ -93,8 +91,8 @@ std::string SimpleColumn_INT<len>::toCppCode(IncludeSet& includes) const
{ {
includes.insert("simplecolumn_int.h"); includes.insert("simplecolumn_int.h");
std::stringstream ss; std::stringstream ss;
ss << "SimpleColumn_INT<" << len << ">(" << std::quoted(fSchemaName) << ", " << std::quoted(fTableName) << ", " << ss << "SimpleColumn_INT<" << len << ">(" << std::quoted(fSchemaName) << ", " << std::quoted(fTableName)
std::quoted(fColumnName) << ", " << fisColumnStore << ", " << sessionID() << ")"; << ", " << std::quoted(fColumnName) << ", " << fisColumnStore << ", " << sessionID() << ")";
return ss.str(); return ss.str();
} }
@ -146,7 +144,7 @@ void SimpleColumn_INT<len>::setNullVal()
} }
template <int len> template <int len>
inline const utils::NullString & SimpleColumn_INT<len>::getStrVal(rowgroup::Row& row, bool& isNull) inline const utils::NullString& SimpleColumn_INT<len>::getStrVal(rowgroup::Row& row, bool& isNull)
{ {
if (row.equals<len>(fNullVal, fInputIndex)) if (row.equals<len>(fNullVal, fInputIndex))
{ {

View File

@ -53,36 +53,34 @@ class SimpleColumn_UINT : public SimpleColumn
public: public:
/** Constructors */ /** Constructors */
SimpleColumn_UINT(); SimpleColumn_UINT();
SimpleColumn_UINT(const std::string& token, const uint32_t sessionID = 0); explicit SimpleColumn_UINT(const std::string& token, const uint32_t sessionID = 0);
SimpleColumn_UINT(const std::string& schema, const std::string& table, const std::string& col, SimpleColumn_UINT(const std::string& schema, const std::string& table, const std::string& col,
const bool isColumnStore, const uint32_t sessionID = 0); const bool isColumnStore, const uint32_t sessionID = 0);
SimpleColumn_UINT(const SimpleColumn& rhs, const uint32_t sessionID = 0); explicit SimpleColumn_UINT(const SimpleColumn& rhs, const uint32_t sessionID = 0);
/** Destructor */ /** Destructor */
virtual ~SimpleColumn_UINT() ~SimpleColumn_UINT() override = default;
{
}
inline virtual SimpleColumn_UINT* clone() const override inline SimpleColumn_UINT* clone() const override
{ {
return new SimpleColumn_UINT<len>(*this); return new SimpleColumn_UINT<len>(*this);
} }
/** Evaluate methods */ /** Evaluate methods */
virtual inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override; inline const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override;
virtual inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override; inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
virtual inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override; inline uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override;
virtual inline float getFloatVal(rowgroup::Row& row, bool& isNull) override; inline float getFloatVal(rowgroup::Row& row, bool& isNull) override;
virtual inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override; inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override; inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
virtual inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override; inline IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override;
/** The serialize interface */ /** The serialize interface */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
uint64_t fNullVal; uint64_t fNullVal;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
void setNullVal(); void setNullVal();

View File

@ -65,17 +65,19 @@ class SimpleFilter : public Filter
SEMI SEMI
}; };
struct ForTestPurposesWithoutColumnsOIDS{}; struct ForTestPurposesWithoutColumnsOIDS
{
};
SimpleFilter(); SimpleFilter();
SimpleFilter(const std::string& sql); explicit SimpleFilter(const std::string& sql);
SimpleFilter(const std::string& sql, ForTestPurposesWithoutColumnsOIDS); SimpleFilter(const std::string& sql, ForTestPurposesWithoutColumnsOIDS);
SimpleFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs, const long timeZone = 0); SimpleFilter(const SOP& op, ReturnedColumn* lhs, ReturnedColumn* rhs, const long timeZone = 0);
SimpleFilter(const SimpleFilter& rhs); SimpleFilter(const SimpleFilter& rhs);
virtual ~SimpleFilter(); ~SimpleFilter() override;
inline virtual SimpleFilter* clone() const override inline SimpleFilter* clone() const override
{ {
return new SimpleFilter(*this); return new SimpleFilter(*this);
} }
@ -106,7 +108,7 @@ class SimpleFilter : public Filter
} }
using Filter::data; using Filter::data;
virtual const std::string data() const override; const std::string data() const override;
/** assign fLhs /** assign fLhs
* *
@ -129,20 +131,20 @@ class SimpleFilter : public Filter
*/ */
void rhs(ReturnedColumn* rhs); void rhs(ReturnedColumn* rhs);
virtual const std::string toString() const override; const std::string toString() const override;
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true if every member of t is a duplicate copy of every member of this; false otherwise * @return true if every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -160,7 +162,6 @@ class SimpleFilter : public Filter
bool operator<(const SimpleFilter& t) const; bool operator<(const SimpleFilter& t) const;
bool semanticEq(const SimpleFilter& t) const; bool semanticEq(const SimpleFilter& t) const;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
@ -168,7 +169,7 @@ class SimpleFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false if every member of t is a duplicate copy of every member of this; true otherwise * @return false if every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -221,7 +222,7 @@ class SimpleFilter : public Filter
static std::string escapeString(const std::string& input); static std::string escapeString(const std::string& input);
virtual string toCppCode(IncludeSet& includes) const override; string toCppCode(IncludeSet& includes) const override;
private: private:
SOP fOp; /// operator SOP fOp; /// operator
@ -237,10 +238,10 @@ class SimpleFilter : public Filter
* F&E framework * * F&E framework *
***********************************************************/ ***********************************************************/
public: public:
inline virtual bool getBoolVal(rowgroup::Row& row, bool& isNull) override; inline bool getBoolVal(rowgroup::Row& row, bool& isNull) override;
inline virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override; inline int64_t getIntVal(rowgroup::Row& row, bool& isNull) override;
inline virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override; inline double getDoubleVal(rowgroup::Row& row, bool& isNull) override;
inline virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override; inline long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override;
// get all simple columns involved in this column // get all simple columns involved in this column
const std::vector<SimpleColumn*>& simpleColumnList(); const std::vector<SimpleColumn*>& simpleColumnList();

View File

@ -65,7 +65,7 @@ class SimpleScalarFilter : public Filter
/** /**
* Destructors * Destructors
*/ */
virtual ~SimpleScalarFilter(); ~SimpleScalarFilter() override;
/** /**
* Accessor Methods * Accessor Methods
@ -100,13 +100,13 @@ class SimpleScalarFilter : public Filter
fSub = sub; fSub = sub;
} }
virtual const std::string toString() const override; const std::string toString() const override;
virtual inline const std::string data() const override inline const std::string data() const override
{ {
return fData; return fData;
} }
virtual inline void data(const std::string data) override inline void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -114,14 +114,14 @@ class SimpleScalarFilter : public Filter
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual SimpleScalarFilter* clone() const override inline SimpleScalarFilter* clone() const override
{ {
return new SimpleScalarFilter(*this); return new SimpleScalarFilter(*this);
} }
@ -131,7 +131,7 @@ class SimpleScalarFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -145,7 +145,7 @@ class SimpleScalarFilter : public Filter
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -154,7 +154,7 @@ class SimpleScalarFilter : public Filter
*/ */
bool operator!=(const SimpleScalarFilter& t) const; bool operator!=(const SimpleScalarFilter& t) const;
virtual string toCppCode(IncludeSet& includes) const override; string toCppCode(IncludeSet& includes) const override;
private: private:
// default okay? // default okay?

View File

@ -269,7 +269,9 @@ class TreeNode
***********************************************************************/ ***********************************************************************/
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull)
{ {
isNull = isNull || fResult.strVal.isNull(); // XXX: NullString returns isNull, we should remove that parameter altogether. isNull = isNull ||
fResult.strVal
.isNull(); // XXX: NullString returns isNull, we should remove that parameter altogether.
return fResult.strVal; return fResult.strVal;
} }
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull)
@ -475,19 +477,20 @@ inline const utils::NullString& TreeNode::getStrVal(const long timeZone)
case CalpontSystemCatalog::VARCHAR: case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7) if (fResultType.colWidth <= 7)
{ {
const char *intAsChar = (const char*) (&fResult.origIntVal); const char* intAsChar = (const char*)(&fResult.origIntVal);
fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar)); fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar));
} }
break; break;
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
case CalpontSystemCatalog::VARBINARY: // XXX: TODO: we don't have varbinary support now, but it may be handled just like varchar. case CalpontSystemCatalog::VARBINARY: // XXX: TODO: we don't have varbinary support now, but it may be
// handled just like varchar.
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 8) if (fResultType.colWidth <= 8)
{ {
const char *intAsChar = (const char*) (&fResult.origIntVal); const char* intAsChar = (const char*)(&fResult.origIntVal);
fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar)); fResult.strVal.assign((const uint8_t*)intAsChar, strlen(intAsChar));
} }
@ -865,27 +868,27 @@ inline double TreeNode::getDoubleVal()
{ {
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
if (fResultType.colWidth <= 8) if (fResultType.colWidth <= 8)
return strtod((char*)(&fResult.origIntVal), NULL); return strtod((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str()); idbassert(fResult.strVal.str());
return strtod(fResult.strVal.str(), NULL); return strtod(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::VARCHAR: case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7) if (fResultType.colWidth <= 7)
return strtod((char*)(&fResult.origIntVal), NULL); return strtod((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str()); idbassert(fResult.strVal.str());
return strtod(fResult.strVal.str(), NULL); return strtod(fResult.strVal.str(), nullptr);
// FIXME: ??? // FIXME: ???
case CalpontSystemCatalog::VARBINARY: case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 7) if (fResultType.colWidth <= 7)
return strtod((char*)(&fResult.origIntVal), NULL); return strtod((char*)(&fResult.origIntVal), nullptr);
//idbassert(fResult.strVal.str()); // idbassert(fResult.strVal.str());
return strtod(fResult.strVal.safeString("").c_str(), NULL); return strtod(fResult.strVal.safeString("").c_str(), nullptr);
case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:
@ -936,27 +939,27 @@ inline long double TreeNode::getLongDoubleVal()
{ {
case CalpontSystemCatalog::CHAR: case CalpontSystemCatalog::CHAR:
if (fResultType.colWidth <= 8) if (fResultType.colWidth <= 8)
return strtold((char*)(&fResult.origIntVal), NULL); return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str()); idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL); return strtold(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::VARCHAR: case CalpontSystemCatalog::VARCHAR:
if (fResultType.colWidth <= 7) if (fResultType.colWidth <= 7)
return strtold((char*)(&fResult.origIntVal), NULL); return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str()); idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL); return strtold(fResult.strVal.str(), nullptr);
// FIXME: ??? // FIXME: ???
case CalpontSystemCatalog::VARBINARY: case CalpontSystemCatalog::VARBINARY:
case CalpontSystemCatalog::BLOB: case CalpontSystemCatalog::BLOB:
case CalpontSystemCatalog::TEXT: case CalpontSystemCatalog::TEXT:
if (fResultType.colWidth <= 7) if (fResultType.colWidth <= 7)
return strtold((char*)(&fResult.origIntVal), NULL); return strtold((char*)(&fResult.origIntVal), nullptr);
idbassert(fResult.strVal.str()); idbassert(fResult.strVal.str());
return strtold(fResult.strVal.str(), NULL); return strtold(fResult.strVal.str(), nullptr);
case CalpontSystemCatalog::BIGINT: case CalpontSystemCatalog::BIGINT:
case CalpontSystemCatalog::TINYINT: case CalpontSystemCatalog::TINYINT:

View File

@ -50,14 +50,14 @@ class TreeNodeImpl : public TreeNode
* Constructors * Constructors
*/ */
TreeNodeImpl(); TreeNodeImpl();
TreeNodeImpl(const std::string& sql); explicit TreeNodeImpl(const std::string& sql);
// not needed yet // not needed yet
// TreeNodeImpl(const TreeNodeImpl& rhs); // TreeNodeImpl(const TreeNodeImpl& rhs);
/** /**
* Destructors * Destructors
*/ */
virtual ~TreeNodeImpl(); ~TreeNodeImpl() override;
/** /**
* Accessor Methods * Accessor Methods
*/ */
@ -65,13 +65,13 @@ class TreeNodeImpl : public TreeNode
/** /**
* Operations * Operations
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
virtual const std::string data() const override const std::string data() const override
{ {
return fData; return fData;
} }
virtual void data(const std::string data) override void data(const std::string data) override
{ {
fData = data; fData = data;
} }
@ -80,7 +80,7 @@ class TreeNodeImpl : public TreeNode
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
inline virtual TreeNodeImpl* clone() const override inline TreeNodeImpl* clone() const override
{ {
return new TreeNodeImpl(*this); return new TreeNodeImpl(*this);
} }
@ -88,15 +88,15 @@ class TreeNodeImpl : public TreeNode
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return true iff every member of t is a duplicate copy of every member of this; false otherwise * @return true iff every member of t is a duplicate copy of every member of this; false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -110,7 +110,7 @@ class TreeNodeImpl : public TreeNode
* Do a deep, strict (as opposed to semantic) equivalence test. * Do a deep, strict (as opposed to semantic) equivalence test.
* @return false iff every member of t is a duplicate copy of every member of this; true otherwise * @return false iff every member of t is a duplicate copy of every member of this; true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -119,7 +119,8 @@ class TreeNodeImpl : public TreeNode
*/ */
bool operator!=(const TreeNodeImpl& t) const; bool operator!=(const TreeNodeImpl& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
// default okay // default okay
// TreeNodeImpl& operator=(const TreeNodeImpl& rhs); // TreeNodeImpl& operator=(const TreeNodeImpl& rhs);

View File

@ -48,25 +48,25 @@ class UDAFColumn : public AggregateColumn
*/ */
UDAFColumn(); UDAFColumn();
UDAFColumn(const uint32_t sessionID); explicit UDAFColumn(const uint32_t sessionID);
UDAFColumn(const UDAFColumn& rhs, const uint32_t sessionID = 0); UDAFColumn(const UDAFColumn& rhs, const uint32_t sessionID = 0);
/** /**
* Destructors * Destructors
*/ */
virtual ~UDAFColumn(); ~UDAFColumn() override;
/** /**
* Overloaded stream operator * Overloaded stream operator
*/ */
virtual const std::string toString() const override; const std::string toString() const override;
/** return a copy of this pointer /** return a copy of this pointer
* *
* deep copy of this pointer and return the copy * deep copy of this pointer and return the copy
*/ */
virtual UDAFColumn* clone() const override UDAFColumn* clone() const override
{ {
return new UDAFColumn(*this); return new UDAFColumn(*this);
} }
@ -82,8 +82,8 @@ class UDAFColumn : public AggregateColumn
/** /**
* Serialize interface * Serialize interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -91,7 +91,7 @@ class UDAFColumn : public AggregateColumn
* @return true iff every member of t is a duplicate copy of every member of this; * @return true iff every member of t is a duplicate copy of every member of this;
* false otherwise * false otherwise
*/ */
virtual bool operator==(const TreeNode* t) const override; bool operator==(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -108,7 +108,7 @@ class UDAFColumn : public AggregateColumn
* @return false iff every member of t is a duplicate copy of every member of this; * @return false iff every member of t is a duplicate copy of every member of this;
* true otherwise * true otherwise
*/ */
virtual bool operator!=(const TreeNode* t) const override; bool operator!=(const TreeNode* t) const override;
/** @brief Do a deep, strict (as opposed to semantic) equivalence test /** @brief Do a deep, strict (as opposed to semantic) equivalence test
* *
@ -119,7 +119,7 @@ class UDAFColumn : public AggregateColumn
using AggregateColumn::operator!=; using AggregateColumn::operator!=;
virtual bool operator!=(const UDAFColumn& t) const; virtual bool operator!=(const UDAFColumn& t) const;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
private: private:
mcsv1sdk::mcsv1Context context; mcsv1sdk::mcsv1Context context;

View File

@ -43,15 +43,11 @@ enum WF_FRAME
struct WF_Boundary struct WF_Boundary
{ {
WF_Boundary() WF_Boundary() = default;
{ explicit WF_Boundary(WF_FRAME frame) : fFrame(frame)
}
WF_Boundary(WF_FRAME frame) : fFrame(frame)
{
}
~WF_Boundary()
{ {
} }
~WF_Boundary() = default;
const std::string toString() const; const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const; void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&); void unserialize(messageqcpp::ByteStream&);
@ -67,9 +63,7 @@ struct WF_Frame
fStart.fFrame = WF_UNBOUNDED_PRECEDING; fStart.fFrame = WF_UNBOUNDED_PRECEDING;
fEnd.fFrame = WF_UNBOUNDED_FOLLOWING; fEnd.fFrame = WF_UNBOUNDED_FOLLOWING;
} }
~WF_Frame() ~WF_Frame() = default;
{
}
const std::string toString() const; const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const; void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&); void unserialize(messageqcpp::ByteStream&);
@ -83,13 +77,11 @@ struct WF_Frame
*/ */
struct WF_OrderBy struct WF_OrderBy
{ {
WF_OrderBy() WF_OrderBy() = default;
explicit WF_OrderBy(std::vector<SRCP> orders) : fOrders(orders)
{ {
} }
WF_OrderBy(std::vector<SRCP> orders) : fOrders(orders) ~WF_OrderBy() = default;
{
}
~WF_OrderBy(){};
const std::string toString() const; const std::string toString() const;
void serialize(messageqcpp::ByteStream&) const; void serialize(messageqcpp::ByteStream&) const;
void unserialize(messageqcpp::ByteStream&); void unserialize(messageqcpp::ByteStream&);

View File

@ -54,14 +54,12 @@ class WindowFunctionColumn : public ReturnedColumn
{ {
public: public:
WindowFunctionColumn(); WindowFunctionColumn();
WindowFunctionColumn(const std::string& functionName, const uint32_t sessionID = 0); explicit WindowFunctionColumn(const std::string& functionName, const uint32_t sessionID = 0);
WindowFunctionColumn(const std::string& functionName, const std::vector<SRCP>& functionParms, WindowFunctionColumn(const std::string& functionName, const std::vector<SRCP>& functionParms,
const std::vector<SRCP>& partitions, WF_OrderBy& orderby, const std::vector<SRCP>& partitions, WF_OrderBy& orderby,
const uint32_t sessionID = 0); const uint32_t sessionID = 0);
WindowFunctionColumn(const WindowFunctionColumn& rhs, const uint32_t sessionID = 0); WindowFunctionColumn(const WindowFunctionColumn& rhs, const uint32_t sessionID = 0);
virtual ~WindowFunctionColumn() ~WindowFunctionColumn() override = default;
{
}
/** get function name */ /** get function name */
inline const std::string& functionName() const inline const std::string& functionName() const
@ -112,7 +110,7 @@ class WindowFunctionColumn : public ReturnedColumn
} }
/** make a clone of this window function */ /** make a clone of this window function */
inline virtual WindowFunctionColumn* clone() const override inline WindowFunctionColumn* clone() const override
{ {
return new WindowFunctionColumn(*this); return new WindowFunctionColumn(*this);
} }
@ -122,22 +120,22 @@ class WindowFunctionColumn : public ReturnedColumn
/** output the function for debug purpose */ /** output the function for debug purpose */
const std::string toString() const override; const std::string toString() const override;
virtual std::string toCppCode(IncludeSet& includes) const override; std::string toCppCode(IncludeSet& includes) const override;
/** /**
* The serialization interface * The serialization interface
*/ */
virtual void serialize(messageqcpp::ByteStream&) const override; void serialize(messageqcpp::ByteStream&) const override;
virtual void unserialize(messageqcpp::ByteStream&) override; void unserialize(messageqcpp::ByteStream&) override;
// util function for connector to use. // util function for connector to use.
void addToPartition(std::vector<SRCP>& groupByList); void addToPartition(std::vector<SRCP>& groupByList);
using ReturnedColumn::hasAggregate; using ReturnedColumn::hasAggregate;
virtual bool hasAggregate() override bool hasAggregate() override
{ {
return false; return false;
} }
virtual bool hasWindowFunc() override; bool hasWindowFunc() override;
void adjustResultType(); void adjustResultType();
// UDAnF support // UDAnF support
@ -170,12 +168,12 @@ class WindowFunctionColumn : public ReturnedColumn
WF_OrderBy fOrderBy; /// order by clause WF_OrderBy fOrderBy; /// order by clause
// not support for window functions for now. // not support for window functions for now.
virtual bool operator==(const TreeNode* t) const override bool operator==(const TreeNode* t) const override
{ {
return false; return false;
} }
bool operator==(const WindowFunctionColumn& t) const; bool operator==(const WindowFunctionColumn& t) const;
virtual bool operator!=(const TreeNode* t) const override bool operator!=(const TreeNode* t) const override
{ {
return false; return false;
} }
@ -190,7 +188,7 @@ class WindowFunctionColumn : public ReturnedColumn
***********************************************************/ ***********************************************************/
public: public:
using TreeNode::getStrVal; using TreeNode::getStrVal;
virtual const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override const utils::NullString& getStrVal(rowgroup::Row& row, bool& isNull) override
{ {
bool localIsNull = false; bool localIsNull = false;
evaluate(row, localIsNull); evaluate(row, localIsNull);
@ -198,57 +196,57 @@ class WindowFunctionColumn : public ReturnedColumn
return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone); return localIsNull ? fResult.strVal.dropString() : TreeNode::getStrVal(fTimeZone);
} }
virtual int64_t getIntVal(rowgroup::Row& row, bool& isNull) override int64_t getIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getIntVal(); return TreeNode::getIntVal();
} }
virtual uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override uint64_t getUintVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getUintVal(); return TreeNode::getUintVal();
} }
virtual float getFloatVal(rowgroup::Row& row, bool& isNull) override float getFloatVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getFloatVal(); return TreeNode::getFloatVal();
} }
virtual double getDoubleVal(rowgroup::Row& row, bool& isNull) override double getDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDoubleVal(); return TreeNode::getDoubleVal();
} }
virtual long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override long double getLongDoubleVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getLongDoubleVal(); return TreeNode::getLongDoubleVal();
} }
virtual IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override IDB_Decimal getDecimalVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDecimalVal(); return TreeNode::getDecimalVal();
} }
virtual int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override int32_t getDateIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDateIntVal(); return TreeNode::getDateIntVal();
} }
virtual int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getDatetimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getDatetimeIntVal(); return TreeNode::getDatetimeIntVal();
} }
virtual int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimestampIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getTimestampIntVal(); return TreeNode::getTimestampIntVal();
} }
virtual int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override int64_t getTimeIntVal(rowgroup::Row& row, bool& isNull) override
{ {
evaluate(row, isNull); evaluate(row, isNull);
return TreeNode::getTimeIntVal(); return TreeNode::getTimeIntVal();

View File

@ -29,7 +29,7 @@
#include <boost/thread/condition.hpp> #include <boost/thread/condition.hpp>
#include "largedatalist.h" #include "largedatalist.h"
//#include "bucketdl.h" // #include "bucketdl.h"
#include <time.h> #include <time.h>
@ -68,9 +68,9 @@ class BandedDL : public LargeDataList<std::vector<element_t>, element_t>
protected: protected:
private: private:
explicit BandedDL(){}; explicit BandedDL() = default;
explicit BandedDL(const BandedDL&){}; BandedDL(const BandedDL&){};
BandedDL& operator=(const BandedDL&){}; BandedDL& operator=(const BandedDL&) {};
// vars to support the WSDL-like next() fcn // vars to support the WSDL-like next() fcn
boost::condition nextSetLoaded; boost::condition nextSetLoaded;

View File

@ -161,7 +161,7 @@ class BucketDL : public DataList<element_t>
private: private:
// Declare default constructors but don't define to disable their use // Declare default constructors but don't define to disable their use
explicit BucketDL(); explicit BucketDL();
explicit BucketDL(const BucketDL<element_t>&); BucketDL(const BucketDL<element_t>&);
BucketDL<element_t>& operator=(const BucketDL<element_t>&); BucketDL<element_t>& operator=(const BucketDL<element_t>&);
ResourceManager* fRm; ResourceManager* fRm;

View File

@ -40,18 +40,17 @@ namespace joblist
class ColumnCommandJL : public CommandJL class ColumnCommandJL : public CommandJL
{ {
public: public:
ColumnCommandJL(const pColScanStep&, std::vector<BRM::LBID_t> lastLBID, ColumnCommandJL(const pColScanStep&, std::vector<BRM::LBID_t> lastLBID, bool hasAuxCol_,
bool hasAuxCol_, const std::vector<BRM::EMEntry>& extentsAux_, const std::vector<BRM::EMEntry>& extentsAux_, execplan::CalpontSystemCatalog::OID oidAux);
execplan::CalpontSystemCatalog::OID oidAux); explicit ColumnCommandJL(const pColStep&);
ColumnCommandJL(const pColStep&);
ColumnCommandJL(const ColumnCommandJL&, const DictStepJL&); ColumnCommandJL(const ColumnCommandJL&, const DictStepJL&);
virtual ~ColumnCommandJL(); ~ColumnCommandJL() override;
virtual void createCommand(messageqcpp::ByteStream& bs) const override; void createCommand(messageqcpp::ByteStream& bs) const override;
virtual void runCommand(messageqcpp::ByteStream& bs) const override; void runCommand(messageqcpp::ByteStream& bs) const override;
void setLBID(uint64_t rid, uint32_t dbroot) override; void setLBID(uint64_t rid, uint32_t dbroot) override;
uint8_t getTableColumnType() override; uint8_t getTableColumnType() override;
virtual std::string toString() override; std::string toString() override;
uint16_t getWidth() override; uint16_t getWidth() override;
CommandType getCommandType() override CommandType getCommandType() override
{ {

View File

@ -60,76 +60,76 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
/** @brief CrossEngineStep destructor /** @brief CrossEngineStep destructor
*/ */
~CrossEngineStep(); ~CrossEngineStep() override;
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
void run(); void run() override;
/** @brief virtual void join method /** @brief virtual void join method
*/ */
void join(); void join() override;
/** @brief virtual string toString method /** @brief virtual string toString method
*/ */
const std::string toString() const; const std::string toString() const override;
// from BatchPrimitive // from BatchPrimitive
bool getFeederFlag() const bool getFeederFlag() const override
{ {
return false; return false;
} }
uint64_t getLastTupleId() const uint64_t getLastTupleId() const override
{ {
return 0; return 0;
} }
uint32_t getStepCount() const uint32_t getStepCount() const override
{ {
return 1; return 1;
} }
void setBPP(JobStep* jobStep); void setBPP(JobStep* jobStep) override;
void setFirstStepType(PrimitiveStepType firstStepType) void setFirstStepType(PrimitiveStepType firstStepType) override
{ {
} }
void setIsProjectionOnly() void setIsProjectionOnly() override
{ {
} }
void setLastTupleId(uint64_t id) void setLastTupleId(uint64_t id) override
{ {
} }
void setOutputType(BPSOutputType outputType) void setOutputType(BPSOutputType outputType) override
{ {
} }
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2); void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2) override;
void setStepCount() void setStepCount() override
{ {
} }
void setSwallowRows(const bool swallowRows) void setSwallowRows(const bool swallowRows) override
{ {
} }
void setBppStep() void setBppStep() override
{ {
} }
void dec(DistributedEngineComm* dec) void dec(DistributedEngineComm* dec) override
{ {
} }
const OIDVector& getProjectOids() const const OIDVector& getProjectOids() const override
{ {
return fOIDVector; return fOIDVector;
} }
uint64_t blksSkipped() const uint64_t blksSkipped() const override
{ {
return 0; return 0;
} }
bool wasStepRun() const bool wasStepRun() const override
{ {
return fRunExecuted; return fRunExecuted;
} }
BPSOutputType getOutputType() const BPSOutputType getOutputType() const override
{ {
return ROW_GROUP; return ROW_GROUP;
} }
uint64_t getRows() const uint64_t getRows() const override
{ {
return fRowsReturned; return fRowsReturned;
} }
@ -145,27 +145,27 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
{ {
return fAlias; return fAlias;
} }
void setJobInfo(const JobInfo* jobInfo) void setJobInfo(const JobInfo* jobInfo) override
{ {
} }
void setOutputRowGroup(const rowgroup::RowGroup&); void setOutputRowGroup(const rowgroup::RowGroup&) override;
const rowgroup::RowGroup& getOutputRowGroup() const; const rowgroup::RowGroup& getOutputRowGroup() const override;
// from DECEventListener // from DECEventListener
void newPMOnline(uint32_t) void newPMOnline(uint32_t) override
{ {
} }
const rowgroup::RowGroup& getDeliveredRowGroup() const; const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b); void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const; bool deliverStringTableRowGroup() const override;
uint32_t nextBand(messageqcpp::ByteStream& bs); uint32_t nextBand(messageqcpp::ByteStream& bs) override;
void addFcnJoinExp(const std::vector<execplan::SRCP>&); void addFcnJoinExp(const std::vector<execplan::SRCP>&) override;
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>&); void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>&) override;
void setFE1Input(const rowgroup::RowGroup&); void setFE1Input(const rowgroup::RowGroup&) override;
void setFcnExpGroup3(const std::vector<execplan::SRCP>&); void setFcnExpGroup3(const std::vector<execplan::SRCP>&) override;
void setFE23Output(const rowgroup::RowGroup&); void setFE23Output(const rowgroup::RowGroup&) override;
void addFilter(JobStep* jobStep); void addFilter(JobStep* jobStep);
void addProject(JobStep* jobStep); void addProject(JobStep* jobStep);
@ -201,7 +201,7 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
class Runner class Runner
{ {
public: public:
Runner(CrossEngineStep* step) : fStep(step) explicit Runner(CrossEngineStep* step) : fStep(step)
{ {
} }
void operator()() void operator()()
@ -248,4 +248,3 @@ class CrossEngineStep : public BatchPrimitive, public TupleDeliveryStep
}; };
} // namespace joblist } // namespace joblist

View File

@ -161,9 +161,10 @@ DataList<element_t>::DataList()
, consumersFinished(0) , consumersFinished(0)
, fElemDiskFirstSize(sizeof(uint64_t)) , fElemDiskFirstSize(sizeof(uint64_t))
, fElemDiskSecondSize(sizeof(uint64_t)) , fElemDiskSecondSize(sizeof(uint64_t))
, fOID(0){ , fOID(0)
// pthread_mutex_init(&mutex, NULL); {
}; // pthread_mutex_init(&mutex, NULL);
}
template <typename element_t> template <typename element_t>
DataList<element_t>::DataList(const DataList<element_t>& dl) DataList<element_t>::DataList(const DataList<element_t>& dl)
@ -174,12 +175,13 @@ DataList<element_t>::DataList(const DataList<element_t>& dl)
consumersFinished = dl.consumersFinished; consumersFinished = dl.consumersFinished;
fElemDiskFirstSize = dl.fElemDiskFirstSize; fElemDiskFirstSize = dl.fElemDiskFirstSize;
fElemDiskSecondSize = dl.fElemDiskSecondSize; fElemDiskSecondSize = dl.fElemDiskSecondSize;
}; }
template <typename element_t> template <typename element_t>
DataList<element_t>::~DataList(){ DataList<element_t>::~DataList()
// pthread_mutex_destroy(&mutex); {
}; // pthread_mutex_destroy(&mutex);
}
template <typename element_t> template <typename element_t>
DataList<element_t>& DataList<element_t>::operator=(const DataList<element_t>& dl) DataList<element_t>& DataList<element_t>::operator=(const DataList<element_t>& dl)
@ -189,25 +191,25 @@ DataList<element_t>& DataList<element_t>::operator=(const DataList<element_t>& d
consumersFinished = dl.consumersFinished; consumersFinished = dl.consumersFinished;
fElemDiskFirstSize = dl.fElemDiskFirstSize; fElemDiskFirstSize = dl.fElemDiskFirstSize;
fElemDiskSecondSize = dl.fElemDiskSecondSize; fElemDiskSecondSize = dl.fElemDiskSecondSize;
}; }
template <typename element_t> template <typename element_t>
void DataList<element_t>::endOfInput() void DataList<element_t>::endOfInput()
{ {
noMoreInput = true; noMoreInput = true;
}; }
template <typename element_t> template <typename element_t>
void DataList<element_t>::lock() void DataList<element_t>::lock()
{ {
mutex.lock(); // pthread_mutex_lock(&mutex); mutex.lock(); // pthread_mutex_lock(&mutex);
}; }
template <typename element_t> template <typename element_t>
void DataList<element_t>::unlock() void DataList<element_t>::unlock()
{ {
mutex.unlock(); // pthread_mutex_unlock(&mutex); mutex.unlock(); // pthread_mutex_unlock(&mutex);
}; }
template <typename element_t> template <typename element_t>
void DataList<element_t>::setDiskElemSize(uint32_t size1st, uint32_t size2nd) void DataList<element_t>::setDiskElemSize(uint32_t size1st, uint32_t size2nd)

View File

@ -44,17 +44,17 @@ template <typename container_t, typename element_t>
class DataListImpl : public DataList<element_t> class DataListImpl : public DataList<element_t>
{ {
public: public:
DataListImpl(uint32_t numConsumers); explicit DataListImpl(uint32_t numConsumers);
DataListImpl(const DataListImpl& dl); DataListImpl(const DataListImpl& dl);
virtual ~DataListImpl(); ~DataListImpl() override;
DataListImpl& operator=(const DataListImpl& dl); DataListImpl& operator=(const DataListImpl& dl);
// derived classes need to lock around these fcns // derived classes need to lock around these fcns
virtual void insert(const element_t& e); void insert(const element_t& e) override;
virtual void insert(const std::vector<element_t>& v); void insert(const std::vector<element_t>& v) override;
virtual uint64_t getIterator(); uint64_t getIterator() override;
virtual bool next(uint64_t it, element_t* e); bool next(uint64_t it, element_t* e) override;
virtual void setNumConsumers(uint32_t); virtual void setNumConsumers(uint32_t);
virtual uint32_t getNumConsumers() const; virtual uint32_t getNumConsumers() const;
@ -141,20 +141,24 @@ DataListImpl<container_t, element_t>::DataListImpl(const DataListImpl<container_
for (i = 0; i < numConsumers; i++) for (i = 0; i < numConsumers; i++)
cIterators[i] = dl.cIterators[i]; cIterators[i] = dl.cIterators[i];
}; }
template <typename container_t, typename element_t> template <typename container_t, typename element_t>
DataListImpl<container_t, element_t>::~DataListImpl() DataListImpl<container_t, element_t>::~DataListImpl()
{ {
delete c; delete c;
delete[] cIterators; delete[] cIterators;
}; }
// lock at a higher level // lock at a higher level
template <typename container_t, typename element_t> template <typename container_t, typename element_t>
DataListImpl<container_t, element_t>& DataListImpl<container_t, element_t>::operator=( DataListImpl<container_t, element_t>& DataListImpl<container_t, element_t>::operator=(
const DataListImpl<container_t, element_t>& dl) const DataListImpl<container_t, element_t>& dl)
{ {
if (&dl == this)
{
return *this;
}
uint64_t i; uint64_t i;
static_cast<DataList<element_t> >(*this) = static_cast<DataList<element_t> >(dl); static_cast<DataList<element_t> >(*this) = static_cast<DataList<element_t> >(dl);
@ -170,7 +174,7 @@ DataListImpl<container_t, element_t>& DataListImpl<container_t, element_t>::oper
cIterators[i] = dl.cIterators[i]; cIterators[i] = dl.cIterators[i];
return *this; return *this;
}; }
template <typename container_t, typename element_t> template <typename container_t, typename element_t>
uint64_t DataListImpl<container_t, element_t>::getIterator() uint64_t DataListImpl<container_t, element_t>::getIterator()
@ -178,8 +182,8 @@ uint64_t DataListImpl<container_t, element_t>::getIterator()
if (itIndex >= numConsumers) if (itIndex >= numConsumers)
{ {
std::ostringstream oss; std::ostringstream oss;
oss << "DataListImpl::getIterator(): caller attempted to grab too many iterators: " oss << "DataListImpl::getIterator(): caller attempted to grab too many iterators: " << "have "
<< "have " << numConsumers << " asked for " << (itIndex + 1); << numConsumers << " asked for " << (itIndex + 1);
throw std::logic_error(oss.str().c_str()); throw std::logic_error(oss.str().c_str());
} }
@ -198,7 +202,7 @@ inline void DataListImpl<container_t, element_t>::insert(const std::vector<eleme
{ {
if (typeid(container_t) == typeid(std::vector<element_t>)) if (typeid(container_t) == typeid(std::vector<element_t>))
{ {
std::vector<element_t>* vc = (std::vector<element_t>*)c; auto* vc = (std::vector<element_t>*)c;
vc->insert(vc->end(), v.begin(), v.end()); vc->insert(vc->end(), v.begin(), v.end());
} }
else else
@ -245,7 +249,7 @@ void DataListImpl<container_t, element_t>::eraseUpTo(uint64_t id)
#endif #endif
c->erase(c->begin(), cIterators[id]); c->erase(c->begin(), cIterators[id]);
}; }
template <typename container_t, typename element_t> template <typename container_t, typename element_t>
void DataListImpl<container_t, element_t>::reset() void DataListImpl<container_t, element_t>::reset()

View File

@ -40,26 +40,27 @@ class DictStepJL : public CommandJL
{ {
public: public:
DictStepJL(); DictStepJL();
DictStepJL(const pDictionaryStep&); explicit DictStepJL(const pDictionaryStep&);
virtual ~DictStepJL(); ~DictStepJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For void setLBID(uint64_t data,
// ColumnCommandJL it's a RID, for a DictStep it's a token. uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
uint8_t getTableColumnType(); // ColumnCommandJL it's a RID, for a DictStep it's a token.
std::string toString(); uint8_t getTableColumnType() override;
std::string toString() override;
/* XXXPAT: The width is only valid for projection steps and the output /* XXXPAT: The width is only valid for projection steps and the output
type is TUPLE at the moment. */ type is TUPLE at the moment. */
void setWidth(uint16_t); void setWidth(uint16_t);
uint16_t getWidth(); uint16_t getWidth() override;
CommandType getCommandType() CommandType getCommandType() override
{ {
return DICT_STEP; return DICT_STEP;
} }
void createCommand(messageqcpp::ByteStream&) const; void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const; void runCommand(messageqcpp::ByteStream&) const override;
messageqcpp::ByteStream getFilterString() const messageqcpp::ByteStream getFilterString() const
{ {

View File

@ -33,11 +33,11 @@ class DiskJoinStep : public JobStep
public: public:
DiskJoinStep(); DiskJoinStep();
DiskJoinStep(TupleHashJoinStep*, int djsIndex, int joinerIndex, bool lastOne); DiskJoinStep(TupleHashJoinStep*, int djsIndex, int joinerIndex, bool lastOne);
virtual ~DiskJoinStep(); ~DiskJoinStep() override;
void run(); void run() override;
void join(); void join() override;
const std::string toString() const; const std::string toString() const override;
void loadExistingData(std::vector<rowgroup::RGData>& data); void loadExistingData(std::vector<rowgroup::RGData>& data);
uint32_t getIterationCount() uint32_t getIterationCount()
@ -73,7 +73,7 @@ class DiskJoinStep : public JobStep
void mainRunner(); void mainRunner();
struct Runner struct Runner
{ {
Runner(DiskJoinStep* d) : djs(d) explicit Runner(DiskJoinStep* d) : djs(d)
{ {
} }
void operator()() void operator()()

View File

@ -77,7 +77,7 @@ constexpr uint32_t defaultLocalConnectionId()
class DECEventListener class DECEventListener
{ {
public: public:
virtual ~DECEventListener(){}; virtual ~DECEventListener() = default;
/* Do whatever needs to be done to init the new PM */ /* Do whatever needs to be done to init the new PM */
virtual void newPMOnline(uint32_t newConnectionNumber) = 0; virtual void newPMOnline(uint32_t newConnectionNumber) = 0;
@ -140,7 +140,7 @@ class DistributedEngineComm
/** reads queuesize/divisor msgs */ /** reads queuesize/divisor msgs */
EXPORT void read_some(uint32_t key, uint32_t divisor, std::vector<messageqcpp::SBS>& v, EXPORT void read_some(uint32_t key, uint32_t divisor, std::vector<messageqcpp::SBS>& v,
bool* flowControlOn = NULL); bool* flowControlOn = nullptr);
/** @brief Write a primitive message /** @brief Write a primitive message
* *

View File

@ -147,9 +147,7 @@ struct RowWrapper
et[i] = rg.et[i]; et[i] = rg.et[i];
} }
~RowWrapper() ~RowWrapper() = default;
{
}
inline RowWrapper& operator=(const RowWrapper& rg) inline RowWrapper& operator=(const RowWrapper& rg)
{ {
@ -170,7 +168,7 @@ struct RIDElementType
uint64_t first; uint64_t first;
RIDElementType(); RIDElementType();
RIDElementType(uint64_t f); explicit RIDElementType(uint64_t f);
const char* getHashString(uint64_t mode, uint64_t* len) const const char* getHashString(uint64_t mode, uint64_t* len) const
{ {
@ -194,9 +192,7 @@ struct TupleType
{ {
uint64_t first; uint64_t first;
char* second; char* second;
TupleType() TupleType() = default;
{
}
TupleType(uint64_t f, char* s) : first(f), second(s) TupleType(uint64_t f, char* s) : first(f), second(s)
{ {
} }
@ -244,14 +240,14 @@ extern std::ostream& operator<<(std::ostream& out, const TupleType& rhs);
#ifndef NO_DATALISTS #ifndef NO_DATALISTS
//#include "bandeddl.h" // #include "bandeddl.h"
//#include "wsdl.h" // #include "wsdl.h"
#include "fifo.h" #include "fifo.h"
//#include "bucketdl.h" // #include "bucketdl.h"
//#include "constantdatalist.h" // #include "constantdatalist.h"
//#include "swsdl.h" // #include "swsdl.h"
//#include "zdl.h" // #include "zdl.h"
//#include "deliverywsdl.h" // #include "deliverywsdl.h"
namespace joblist namespace joblist
{ {
@ -350,7 +346,6 @@ class AnyDataList
~AnyDataList() = default; ~AnyDataList() = default;
inline void rowGroupDL(boost::shared_ptr<RowGroupDL> dl) inline void rowGroupDL(boost::shared_ptr<RowGroupDL> dl)
{ {
fDatalist = dl; fDatalist = dl;
@ -368,8 +363,6 @@ class AnyDataList
return fDatalist.get(); return fDatalist.get();
} }
enum DataListTypes enum DataListTypes
{ {
UNKNOWN_DATALIST, /*!< 0 Unknown DataList */ UNKNOWN_DATALIST, /*!< 0 Unknown DataList */
@ -408,8 +401,8 @@ class AnyDataList
// bool operator==(const AnyDataList& rhs); // bool operator==(const AnyDataList& rhs);
private: private:
AnyDataList(const AnyDataList& rhs); AnyDataList(const AnyDataList& rhs) = delete;
AnyDataList& operator=(const AnyDataList& rhs); AnyDataList& operator=(const AnyDataList& rhs) = delete;
boost::shared_ptr<RowGroupDL> fDatalist; boost::shared_ptr<RowGroupDL> fDatalist;
bool fDisown; bool fDisown;
}; };
@ -435,4 +428,3 @@ extern std::ostream& omitOidInDL(std::ostream& strm);
} // namespace joblist } // namespace joblist
#endif #endif

View File

@ -38,7 +38,7 @@ struct ErrorInfo
uint32_t errCode; uint32_t errCode;
std::string errMsg; std::string errMsg;
// for backward compat // for backward compat
ErrorInfo(uint16_t v) : errCode(v) explicit ErrorInfo(uint16_t v) : errCode(v)
{ {
} }
ErrorInfo& operator=(uint16_t v) ErrorInfo& operator=(uint16_t v)
@ -51,4 +51,3 @@ struct ErrorInfo
typedef boost::shared_ptr<ErrorInfo> SErrorInfo; typedef boost::shared_ptr<ErrorInfo> SErrorInfo;
} // namespace joblist } // namespace joblist

View File

@ -23,7 +23,7 @@
#pragma once #pragma once
//#define NDEBUG // #define NDEBUG
#include "jobstep.h" #include "jobstep.h"
#include "filter.h" #include "filter.h"
@ -48,35 +48,35 @@ class ExpressionStep : public JobStep
public: public:
// constructors // constructors
ExpressionStep(); ExpressionStep();
ExpressionStep(const JobInfo&); explicit ExpressionStep(const JobInfo&);
// destructor constructors // destructor constructors
virtual ~ExpressionStep(); ~ExpressionStep() override;
// inherited methods // inherited methods
void run(); void run() override;
void join(); void join() override;
const std::string toString() const; const std::string toString() const override;
execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return 0; return 0;
} }
execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOids.empty() ? 0 : fTableOids.front(); return fTableOids.empty() ? 0 : fTableOids.front();
} }
using JobStep::alias; using JobStep::alias;
std::string alias() const std::string alias() const override
{ {
return fAliases.empty() ? "" : fAliases.front(); return fAliases.empty() ? "" : fAliases.front();
} }
using JobStep::view; using JobStep::view;
std::string view() const std::string view() const override
{ {
return fViews.empty() ? "" : fViews.front(); return fViews.empty() ? "" : fViews.front();
} }
using JobStep::schema; using JobStep::schema;
std::string schema() const std::string schema() const override
{ {
return fSchemas.empty() ? "" : fSchemas.front(); return fSchemas.empty() ? "" : fSchemas.front();
} }

View File

@ -45,7 +45,7 @@ template <typename element_t>
class FIFO : public DataListImpl<std::vector<element_t>, element_t> class FIFO : public DataListImpl<std::vector<element_t>, element_t>
{ {
private: private:
typedef DataListImpl<std::vector<element_t>, element_t> base; using base = DataListImpl<std::vector<element_t>, element_t>;
public: public:
enum ElementMode enum ElementMode
@ -55,15 +55,15 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
}; };
FIFO(uint32_t numConsumers, uint32_t maxElements); FIFO(uint32_t numConsumers, uint32_t maxElements);
virtual ~FIFO(); ~FIFO() override;
/* DataList<element_t> interface */ /* DataList<element_t> interface */
inline void insert(const element_t& e); inline void insert(const element_t& e) override;
inline void insert(const std::vector<element_t>& v); inline void insert(const std::vector<element_t>& v) override;
inline bool next(uint64_t it, element_t* e); inline bool next(uint64_t it, element_t* e) override;
uint64_t getIterator(); uint64_t getIterator() override;
void endOfInput(); void endOfInput() override;
void setMultipleProducers(bool b); void setMultipleProducers(bool b) override;
/* Use this insert() to detect when insertion fills up buffer. */ /* Use this insert() to detect when insertion fills up buffer. */
/* When this happens, call waitTillReadyForInserts() before resuming*/ /* When this happens, call waitTillReadyForInserts() before resuming*/
@ -72,16 +72,16 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
inline void waitTillReadyForInserts(); inline void waitTillReadyForInserts();
inline bool isOutputBlocked() const; inline bool isOutputBlocked() const;
void OID(execplan::CalpontSystemCatalog::OID oid) void OID(execplan::CalpontSystemCatalog::OID oid) override
{ {
base::OID(oid); base::OID(oid);
} }
execplan::CalpontSystemCatalog::OID OID() const execplan::CalpontSystemCatalog::OID OID() const override
{ {
return base::OID(); return base::OID();
} }
inline void dropToken(){}; inline void dropToken() {};
inline void dropToken(uint32_t){}; inline void dropToken(uint32_t){};
// Counters that reflect how many many times this FIFO blocked on reads/writes // Counters that reflect how many many times this FIFO blocked on reads/writes
@ -89,7 +89,7 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
uint64_t blockedReadCount() const; uint64_t blockedReadCount() const;
// @bug 653 set number of consumers when it is empty. // @bug 653 set number of consumers when it is empty.
void setNumConsumers(uint32_t nc); void setNumConsumers(uint32_t nc) override;
void inOrder(bool order) void inOrder(bool order)
{ {
@ -109,7 +109,7 @@ class FIFO : public DataListImpl<std::vector<element_t>, element_t>
{ {
fTotSize = totSize; fTotSize = totSize;
} }
uint64_t totalSize() uint64_t totalSize() override
{ {
return fTotSize; return fTotSize;
} }
@ -495,14 +495,11 @@ void FIFO<element_t>::maxElements(uint64_t max)
{ {
fMaxElements = max; fMaxElements = max;
if (pBuffer) delete[] pBuffer;
delete[] pBuffer; delete[] cBuffer;
if (cBuffer) pBuffer = nullptr;
delete[] cBuffer; cBuffer = nullptr;
pBuffer = 0;
cBuffer = 0;
for (uint64_t i = 0; i < base::numConsumers; ++i) for (uint64_t i = 0; i < base::numConsumers; ++i)
cpos[i] = fMaxElements; cpos[i] = fMaxElements;
@ -528,4 +525,3 @@ void FIFO<element_t>::totalFileCounts(uint64_t& numFiles, uint64_t& numBytes) co
} }
} // namespace joblist } // namespace joblist

View File

@ -34,16 +34,16 @@ namespace joblist
class FilterCommandJL : public CommandJL class FilterCommandJL : public CommandJL
{ {
public: public:
FilterCommandJL(const FilterStep&); explicit FilterCommandJL(const FilterStep&);
virtual ~FilterCommandJL(); ~FilterCommandJL() override;
void setLBID(uint64_t rid, uint32_t dbroot); void setLBID(uint64_t rid, uint32_t dbroot) override;
uint8_t getTableColumnType(); uint8_t getTableColumnType() override;
CommandType getCommandType(); CommandType getCommandType() override;
std::string toString(); std::string toString() override;
void createCommand(messageqcpp::ByteStream& bs) const; void createCommand(messageqcpp::ByteStream& bs) const override;
void runCommand(messageqcpp::ByteStream& bs) const; void runCommand(messageqcpp::ByteStream& bs) const override;
uint16_t getWidth(); uint16_t getWidth() override;
uint8_t getBOP() const uint8_t getBOP() const
{ {
return fBOP; return fBOP;

View File

@ -26,7 +26,6 @@
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include "returnedcolumn.h" // SRCP #include "returnedcolumn.h" // SRCP
#include "rowgroup.h" // RowGroup #include "rowgroup.h" // RowGroup
#include "rowaggregation.h" // SP_GroupConcat #include "rowaggregation.h" // SP_GroupConcat
@ -48,7 +47,7 @@ class GroupConcatInfo
virtual ~GroupConcatInfo(); virtual ~GroupConcatInfo();
void prepGroupConcat(JobInfo&); void prepGroupConcat(JobInfo&);
void mapColumns(const rowgroup::RowGroup&); virtual void mapColumns(const rowgroup::RowGroup&);
std::set<uint32_t>& columns() std::set<uint32_t>& columns()
{ {
@ -59,11 +58,11 @@ class GroupConcatInfo
return fGroupConcat; return fGroupConcat;
} }
const std::string toString() const; virtual const std::string toString() const;
protected: protected:
uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo); virtual uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo);
std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&); virtual std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&);
std::set<uint32_t> fColumns; std::set<uint32_t> fColumns;
std::vector<rowgroup::SP_GroupConcat> fGroupConcat; std::vector<rowgroup::SP_GroupConcat> fGroupConcat;
@ -72,22 +71,22 @@ class GroupConcatInfo
class GroupConcatAgUM : public rowgroup::GroupConcatAg class GroupConcatAgUM : public rowgroup::GroupConcatAg
{ {
public: public:
EXPORT GroupConcatAgUM(rowgroup::SP_GroupConcat&); EXPORT explicit GroupConcatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~GroupConcatAgUM(); EXPORT ~GroupConcatAgUM() override;
using rowgroup::GroupConcatAg::merge; using rowgroup::GroupConcatAg::merge;
void initialize(); void initialize() override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
EXPORT void merge(const rowgroup::Row&, int64_t); EXPORT virtual void merge(const rowgroup::Row&, int64_t);
boost::scoped_ptr<GroupConcator>& concator() boost::scoped_ptr<GroupConcator>& concator()
{ {
return fConcator; return fConcator;
} }
EXPORT uint8_t* getResult(); EXPORT uint8_t* getResult() override;
protected: protected:
void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&); virtual void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&);
boost::scoped_ptr<GroupConcator> fConcator; boost::scoped_ptr<GroupConcator> fConcator;
boost::scoped_array<uint8_t> fData; boost::scoped_array<uint8_t> fData;
@ -133,17 +132,17 @@ class GroupConcatNoOrder : public GroupConcator
{ {
public: public:
GroupConcatNoOrder(); GroupConcatNoOrder();
virtual ~GroupConcatNoOrder(); ~GroupConcatNoOrder() override;
void initialize(const rowgroup::SP_GroupConcat&); void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
void merge(GroupConcator*); void merge(GroupConcator*) override;
using GroupConcator::getResult; using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep); uint8_t* getResultImpl(const std::string& sep) override;
//uint8_t* getResult(const std::string& sep); // uint8_t* getResult(const std::string& sep);
const std::string toString() const; const std::string toString() const override;
protected: protected:
rowgroup::RowGroup fRowGroup; rowgroup::RowGroup fRowGroup;
@ -163,19 +162,19 @@ class GroupConcatOrderBy : public GroupConcator, public ordering::IdbOrderBy
{ {
public: public:
GroupConcatOrderBy(); GroupConcatOrderBy();
virtual ~GroupConcatOrderBy(); ~GroupConcatOrderBy() override;
using ordering::IdbOrderBy::initialize; using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::SP_GroupConcat&); void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const; uint64_t getKeyLength() const override;
void merge(GroupConcator*); void merge(GroupConcator*) override;
using GroupConcator::getResult; using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep); uint8_t* getResultImpl(const std::string& sep) override;
//uint8_t* getResult(const std::string& sep); // uint8_t* getResult(const std::string& sep);
const std::string toString() const; const std::string toString() const override;
protected: protected:
}; };

View File

@ -73,15 +73,14 @@ const int32_t CNX_EXP_TABLE_ID = 999;
struct TupleInfo struct TupleInfo
{ {
TupleInfo(uint32_t w = 0, uint32_t o = 0, uint32_t k = -1, uint32_t t = -1, uint32_t s = 0, uint32_t p = 0, explicit TupleInfo(uint32_t w = 0, uint32_t o = 0, uint32_t k = -1, uint32_t t = -1, uint32_t s = 0,
execplan::CalpontSystemCatalog::ColDataType dt = execplan::CalpontSystemCatalog::BIT, uint32_t p = 0,
uint32_t csn = 8) execplan::CalpontSystemCatalog::ColDataType dt = execplan::CalpontSystemCatalog::BIT,
uint32_t csn = 8)
: width(w), oid(o), key(k), tkey(t), scale(s), precision(p), dtype(dt), csNum(csn) : width(w), oid(o), key(k), tkey(t), scale(s), precision(p), dtype(dt), csNum(csn)
{ {
} }
~TupleInfo() ~TupleInfo() = default;
{
}
uint32_t width; uint32_t width;
uint32_t oid; uint32_t oid;
@ -146,7 +145,7 @@ struct UniqId
: fId(i), fTable(t), fSchema(s), fView(v), fPseudo(pi), fSubId(l) : fId(i), fTable(t), fSchema(s), fView(v), fPseudo(pi), fSubId(l)
{ {
} }
UniqId(const execplan::SimpleColumn* sc); explicit UniqId(const execplan::SimpleColumn* sc);
UniqId(int o, const execplan::SimpleColumn* sc); UniqId(int o, const execplan::SimpleColumn* sc);
std::string toString() const; std::string toString() const;
@ -193,7 +192,7 @@ struct TupleKeyInfo
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
struct JobInfo struct JobInfo
{ {
JobInfo(ResourceManager* r) explicit JobInfo(ResourceManager* r)
: rm(r) : rm(r)
, sessionId(0) , sessionId(0)
, txnId(0) , txnId(0)
@ -204,7 +203,7 @@ struct JobInfo
, fifoSize(rm->getJlFifoSize()) , fifoSize(rm->getJlFifoSize())
, logger(new Logger()) , logger(new Logger())
, traceFlags(0) , traceFlags(0)
, projectingTableOID(0) , projectingTableOID(nullptr)
, isExeMgr(false) , isExeMgr(false)
, trace(false) , trace(false)
, tryTuples(false) , tryTuples(false)
@ -219,7 +218,7 @@ struct JobInfo
, subLevel(0) , subLevel(0)
, subNum(0) , subNum(0)
, subId(0) , subId(0)
, pJobInfo(NULL) , pJobInfo(nullptr)
, constantFalse(false) , constantFalse(false)
, cntStarPos(-1) , cntStarPos(-1)
, stringScanThreshold(1) , stringScanThreshold(1)

View File

@ -217,10 +217,10 @@ class JobList
class TupleJobList : public JobList class TupleJobList : public JobList
{ {
public: public:
TupleJobList(bool isEM = false); explicit TupleJobList(bool isEM = false);
virtual ~TupleJobList(); ~TupleJobList() override;
EXPORT uint32_t projectTable(execplan::CalpontSystemCatalog::OID, messageqcpp::ByteStream&); EXPORT uint32_t projectTable(execplan::CalpontSystemCatalog::OID, messageqcpp::ByteStream&) override;
EXPORT const rowgroup::RowGroup& getOutputRowGroup() const; EXPORT const rowgroup::RowGroup& getOutputRowGroup() const;
TupleDeliveryStep* getDeliveryStep() TupleDeliveryStep* getDeliveryStep()
{ {
@ -231,7 +231,7 @@ class TupleJobList : public JobList
return fQuery; return fQuery;
} }
void setDeliveryFlag(bool f); void setDeliveryFlag(bool f);
void abort(); void abort() override;
/** Does some light validation on the final joblist /** Does some light validation on the final joblist
* *
@ -239,7 +239,7 @@ class TupleJobList : public JobList
* there's one and only one projection step, and that its fake table OID is 100. * there's one and only one projection step, and that its fake table OID is 100.
* @note The fake OID check is disabled atm because it's not always 100 although it's supposed to be. * @note The fake OID check is disabled atm because it's not always 100 although it's supposed to be.
*/ */
EXPORT void validate() const; EXPORT void validate() const override;
private: private:
// defaults okay // defaults okay
@ -255,4 +255,3 @@ typedef boost::shared_ptr<TupleJobList> STJLP;
} // namespace joblist } // namespace joblist
#undef EXPORT #undef EXPORT

View File

@ -60,12 +60,8 @@ namespace joblist
class JobStepAssociation class JobStepAssociation
{ {
public: public:
JobStepAssociation() JobStepAssociation() = default;
{ virtual ~JobStepAssociation() = default;
}
virtual ~JobStepAssociation()
{
}
void inAdd(const AnyDataListSPtr& spdl) __attribute__((deprecated)) void inAdd(const AnyDataListSPtr& spdl) __attribute__((deprecated))
{ {
@ -127,10 +123,8 @@ class JobStep
public: public:
/** constructor /** constructor
*/ */
JobStep() JobStep() = default;
{ explicit JobStep(const JobInfo&);
}
JobStep(const JobInfo&);
/** destructor /** destructor
*/ */
virtual ~JobStep() virtual ~JobStep()
@ -508,12 +502,8 @@ class JobStep
class TupleJobStep class TupleJobStep
{ {
public: public:
TupleJobStep() TupleJobStep() = default;
{ virtual ~TupleJobStep() = default;
}
virtual ~TupleJobStep()
{
}
virtual void setOutputRowGroup(const rowgroup::RowGroup&) = 0; virtual void setOutputRowGroup(const rowgroup::RowGroup&) = 0;
virtual void setFcnExpGroup3(const std::vector<execplan::SRCP>&) virtual void setFcnExpGroup3(const std::vector<execplan::SRCP>&)
{ {
@ -527,9 +517,7 @@ class TupleJobStep
class TupleDeliveryStep : public TupleJobStep class TupleDeliveryStep : public TupleJobStep
{ {
public: public:
virtual ~TupleDeliveryStep() ~TupleDeliveryStep() override = default;
{
}
virtual uint32_t nextBand(messageqcpp::ByteStream& bs) = 0; virtual uint32_t nextBand(messageqcpp::ByteStream& bs) = 0;
virtual const rowgroup::RowGroup& getDeliveredRowGroup() const = 0; virtual const rowgroup::RowGroup& getDeliveredRowGroup() const = 0;
virtual void deliverStringTableRowGroup(bool b) = 0; virtual void deliverStringTableRowGroup(bool b) = 0;
@ -541,17 +529,17 @@ class NullStep : public JobStep
public: public:
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
virtual void run() void run() override
{ {
} }
/** @brief virtual void join method /** @brief virtual void join method
*/ */
virtual void join() void join() override
{ {
} }
/** @brief virtual string toString method /** @brief virtual string toString method
*/ */
virtual const std::string toString() const const std::string toString() const override
{ {
return "NullStep"; return "NullStep";
} }
@ -566,4 +554,3 @@ typedef boost::shared_ptr<JobStepAssociation> JobStepAssociationSPtr;
typedef boost::shared_ptr<JobStep> SJSTEP; typedef boost::shared_ptr<JobStep> SJSTEP;
} // namespace joblist } // namespace joblist

View File

@ -24,7 +24,6 @@
#include <vector> #include <vector>
#include <boost/scoped_ptr.hpp> #include <boost/scoped_ptr.hpp>
#include "groupconcat.h" #include "groupconcat.h"
#define EXPORT #define EXPORT
@ -39,31 +38,31 @@ class JsonArrayInfo : public GroupConcatInfo
{ {
public: public:
void prepJsonArray(JobInfo&); void prepJsonArray(JobInfo&);
void mapColumns(const rowgroup::RowGroup&); void mapColumns(const rowgroup::RowGroup&) override;
const std::string toString() const; const std::string toString() const override;
protected: protected:
uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo); uint32_t getColumnKey(const execplan::SRCP& srcp, JobInfo& jobInfo) override;
std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&); std::shared_ptr<int[]> makeMapping(const rowgroup::RowGroup&, const rowgroup::RowGroup&) override;
}; };
class JsonArrayAggregatAgUM : public GroupConcatAgUM class JsonArrayAggregatAgUM : public GroupConcatAgUM
{ {
public: public:
EXPORT JsonArrayAggregatAgUM(rowgroup::SP_GroupConcat&); EXPORT explicit JsonArrayAggregatAgUM(rowgroup::SP_GroupConcat&);
EXPORT ~JsonArrayAggregatAgUM(); EXPORT ~JsonArrayAggregatAgUM() override;
using rowgroup::GroupConcatAg::merge; using rowgroup::GroupConcatAg::merge;
void initialize(); void initialize() override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
EXPORT void merge(const rowgroup::Row&, int64_t); EXPORT void merge(const rowgroup::Row&, int64_t) override;
EXPORT void getResult(uint8_t*); EXPORT void getResult(uint8_t*);
EXPORT uint8_t* getResult(); EXPORT uint8_t* getResult() override;
protected: protected:
void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&); void applyMapping(const std::shared_ptr<int[]>&, const rowgroup::Row&) override;
}; };
// JSON_ARRAYAGG base // JSON_ARRAYAGG base
@ -71,17 +70,17 @@ class JsonArrayAggregator : public GroupConcator
{ {
public: public:
JsonArrayAggregator(); JsonArrayAggregator();
virtual ~JsonArrayAggregator(); ~JsonArrayAggregator() override;
virtual void initialize(const rowgroup::SP_GroupConcat&); void initialize(const rowgroup::SP_GroupConcat&) override;
virtual void processRow(const rowgroup::Row&) = 0; void processRow(const rowgroup::Row&) override = 0;
virtual const std::string toString() const; const std::string toString() const override;
protected: protected:
virtual bool concatColIsNull(const rowgroup::Row&); bool concatColIsNull(const rowgroup::Row&) override;
virtual void outputRow(std::ostringstream&, const rowgroup::Row&); void outputRow(std::ostringstream&, const rowgroup::Row&) override;
virtual int64_t lengthEstimate(const rowgroup::Row&); int64_t lengthEstimate(const rowgroup::Row&) override;
}; };
// For JSON_ARRAYAGG withour distinct or orderby // For JSON_ARRAYAGG withour distinct or orderby
@ -89,17 +88,17 @@ class JsonArrayAggNoOrder : public JsonArrayAggregator
{ {
public: public:
JsonArrayAggNoOrder(); JsonArrayAggNoOrder();
virtual ~JsonArrayAggNoOrder(); ~JsonArrayAggNoOrder() override;
void initialize(const rowgroup::SP_GroupConcat&); void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
using GroupConcator::merge; using GroupConcator::merge;
void merge(GroupConcator*); void merge(GroupConcator*) override;
using GroupConcator::getResult; using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep); uint8_t* getResultImpl(const std::string& sep) override;
const std::string toString() const; const std::string toString() const override;
protected: protected:
rowgroup::RowGroup fRowGroup; rowgroup::RowGroup fRowGroup;
@ -118,19 +117,19 @@ class JsonArrayAggOrderBy : public JsonArrayAggregator, public ordering::IdbOrde
{ {
public: public:
JsonArrayAggOrderBy(); JsonArrayAggOrderBy();
virtual ~JsonArrayAggOrderBy(); ~JsonArrayAggOrderBy() override;
using ordering::IdbOrderBy::initialize; using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::SP_GroupConcat&); void initialize(const rowgroup::SP_GroupConcat&) override;
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const; uint64_t getKeyLength() const override;
using GroupConcator::merge; using GroupConcator::merge;
void merge(GroupConcator*); void merge(GroupConcator*) override;
using GroupConcator::getResult; using GroupConcator::getResult;
uint8_t* getResultImpl(const std::string& sep); uint8_t* getResultImpl(const std::string& sep) override;
const std::string toString() const; const std::string toString() const override;
protected: protected:
}; };

View File

@ -89,7 +89,7 @@ struct DiskIoInfo
bool fWrite; bool fWrite;
// c: byte count; b: is write operation? // c: byte count; b: is write operation?
DiskIoInfo(bool b = false) : fBytes(0), fWrite(b) explicit DiskIoInfo(bool b = false) : fBytes(0), fWrite(b)
{ {
} }
}; };
@ -205,7 +205,7 @@ LargeDataList<container_t, element_t>::LargeDataList(uint32_t nc, uint32_t eleme
, fTraceOn(false) , fTraceOn(false)
, fReUse(false) , fReUse(false)
, fSaveForReuse(false) , fSaveForReuse(false)
, fRestoreInfo(NULL) , fRestoreInfo(nullptr)
{ {
loadedSet = 0; loadedSet = 0;
setCount = 1; setCount = 1;

View File

@ -256,9 +256,7 @@ class HashJoin
}; };
template <typename element_t> template <typename element_t>
HashJoin<element_t>::HashJoin() HashJoin<element_t>::HashJoin() = default;
{
}
template <typename element_t> template <typename element_t>
HashJoin<element_t>::HashJoin(joblist::BDLWrapper<element_t>& set1, joblist::BDLWrapper<element_t>& set2, HashJoin<element_t>::HashJoin(joblist::BDLWrapper<element_t>& set1, joblist::BDLWrapper<element_t>& set2,

View File

@ -38,17 +38,17 @@ class LimitedOrderBy : public ordering::IdbOrderBy
{ {
public: public:
LimitedOrderBy(); LimitedOrderBy();
virtual ~LimitedOrderBy(); ~LimitedOrderBy() override;
using ordering::IdbOrderBy::initialize; using ordering::IdbOrderBy::initialize;
void initialize(const rowgroup::RowGroup&, const JobInfo&, bool invertRules = false, void initialize(const rowgroup::RowGroup&, const JobInfo&, bool invertRules = false,
bool isMultiThreded = false); bool isMultiThreded = false);
void processRow(const rowgroup::Row&); void processRow(const rowgroup::Row&) override;
uint64_t getKeyLength() const; uint64_t getKeyLength() const override;
uint64_t getLimitCount() const uint64_t getLimitCount() const
{ {
return fCount; return fCount;
} }
const std::string toString() const; const std::string toString() const override;
void finalize(); void finalize();

View File

@ -41,18 +41,19 @@ class PassThruStep;
class PassThruCommandJL : public CommandJL class PassThruCommandJL : public CommandJL
{ {
public: public:
PassThruCommandJL(const PassThruStep&); explicit PassThruCommandJL(const PassThruStep&);
virtual ~PassThruCommandJL(); ~PassThruCommandJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For void setLBID(uint64_t data,
// ColumnCommandJL it's a RID, for a DictStep it's a token. uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
uint8_t getTableColumnType(); // ColumnCommandJL it's a RID, for a DictStep it's a token.
std::string toString(); uint8_t getTableColumnType() override;
std::string toString() override;
void createCommand(messageqcpp::ByteStream&) const; void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const; void runCommand(messageqcpp::ByteStream&) const override;
uint16_t getWidth(); uint16_t getWidth() override;
CommandType getCommandType() CommandType getCommandType() override
{ {
return PASS_THRU; return PASS_THRU;
} }

View File

@ -35,7 +35,6 @@
#pragma pack(push, 1) #pragma pack(push, 1)
// from blocksize.h // from blocksize.h
const int32_t DATA_BLOCK_SIZE = BLOCK_SIZE; const int32_t DATA_BLOCK_SIZE = BLOCK_SIZE;
@ -65,7 +64,7 @@ using utils::ConstString;
class StringComparator : public datatypes::Charset class StringComparator : public datatypes::Charset
{ {
public: public:
StringComparator(const Charset& cs) : Charset(cs) explicit StringComparator(const Charset& cs) : Charset(cs)
{ {
} }
bool op(int* error, uint8_t COP, const ConstString& str1, const ConstString& str2) const bool op(int* error, uint8_t COP, const ConstString& str1, const ConstString& str2) const
@ -74,7 +73,8 @@ class StringComparator : public datatypes::Charset
return like(COP & COMPARE_NOT, str1, str2); return like(COP & COMPARE_NOT, str1, str2);
if (COP == COMPARE_NULLEQ) if (COP == COMPARE_NULLEQ)
return str1.isNull() == str2.isNull(); // XXX: TODO: I do not know the logic here, so it is temporary solution. return str1.isNull() ==
str2.isNull(); // XXX: TODO: I do not know the logic here, so it is temporary solution.
int cmp = strnncollsp(str1, str2); int cmp = strnncollsp(str1, str2);
@ -335,7 +335,7 @@ struct ColRequestHeaderDataType : public datatypes::Charset
ColRequestHeaderDataType() : Charset(my_charset_bin), CompType(0), DataSize(0), DataType(0) ColRequestHeaderDataType() : Charset(my_charset_bin), CompType(0), DataSize(0), DataType(0)
{ {
} }
ColRequestHeaderDataType(const execplan::CalpontSystemCatalog::ColType& rhs) explicit ColRequestHeaderDataType(const execplan::CalpontSystemCatalog::ColType& rhs)
: Charset(rhs.charsetNumber) : Charset(rhs.charsetNumber)
, CompType(rhs.compressionType) , CompType(rhs.compressionType)
, DataSize(rhs.colWidth) , DataSize(rhs.colWidth)
@ -633,7 +633,7 @@ struct TokenByScanResultHeader
uint16_t Pad1; uint16_t Pad1;
uint32_t CacheIO; // I/O count from buffer cache uint32_t CacheIO; // I/O count from buffer cache
uint32_t PhysicalIO; // Physical I/O count from disk uint32_t PhysicalIO; // Physical I/O count from disk
}; // what follows is NVALS Tokens or DataValues. }; // what follows is NVALS Tokens or DataValues.
// DICT_SIGNATURE // DICT_SIGNATURE
@ -889,5 +889,4 @@ struct LbidAtVer
uint32_t Ver; uint32_t Ver;
}; };
#pragma pack(pop) #pragma pack(pop)

View File

@ -102,26 +102,26 @@ class pColStep : public JobStep
pColStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid, pColStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo); const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
pColStep(const pColScanStep& rhs); explicit pColStep(const pColScanStep& rhs);
pColStep(const PassThruStep& rhs); explicit pColStep(const PassThruStep& rhs);
virtual ~pColStep(){}; ~pColStep() override = default;
/** @brief Starts processing. Set at least the RID list before calling. /** @brief Starts processing. Set at least the RID list before calling.
* *
* Starts processing. Set at least the RID list before calling this. * Starts processing. Set at least the RID list before calling this.
*/ */
virtual void run() {}; void run() override {};
/** @brief Sync's the caller with the end of execution. /** @brief Sync's the caller with the end of execution.
* *
* Does nothing. Returns when this instance is finished. * Does nothing. Returns when this instance is finished.
*/ */
virtual void join() {}; void join() override {};
virtual const std::string toString() const; const std::string toString() const override;
virtual bool isDictCol() const bool isDictCol() const override
{ {
return fIsDict; return fIsDict;
} }
@ -186,12 +186,12 @@ class pColStep : public JobStep
return fSwallowRows; return fSwallowRows;
} }
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -222,15 +222,15 @@ class pColStep : public JobStep
{ {
isFilterFeeder = filterFeeder; isFilterFeeder = filterFeeder;
} }
virtual uint64_t msgsRcvdCount() const uint64_t msgsRcvdCount() const override
{ {
return msgsRecvd; return msgsRecvd;
} }
virtual uint64_t msgBytesIn() const uint64_t msgBytesIn() const override
{ {
return fMsgBytesIn; return fMsgBytesIn;
} }
virtual uint64_t msgBytesOut() const uint64_t msgBytesOut() const override
{ {
return fMsgBytesOut; return fMsgBytesOut;
} }
@ -336,16 +336,14 @@ class pColScanStep : public JobStep
pColScanStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid, pColScanStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo); const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
pColScanStep(const pColStep& rhs); explicit pColScanStep(const pColStep& rhs);
~pColScanStep() ~pColScanStep() override = default;
{
}
/** @brief Starts processing. /** @brief Starts processing.
* *
* Starts processing. * Starts processing.
*/ */
virtual void run() void run() override
{ {
} }
@ -353,11 +351,11 @@ class pColScanStep : public JobStep
* *
* Does nothing. Returns when this instance is finished. * Does nothing. Returns when this instance is finished.
*/ */
virtual void join() void join() override
{ {
} }
virtual bool isDictCol() const bool isDictCol() const override
{ {
return fIsDict; return fIsDict;
}; };
@ -413,14 +411,14 @@ class pColScanStep : public JobStep
return fFilterCount; return fFilterCount;
} }
virtual const std::string toString() const; const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -433,11 +431,11 @@ class pColScanStep : public JobStep
return fRm; return fRm;
} }
virtual uint64_t msgBytesIn() const uint64_t msgBytesIn() const override
{ {
return fMsgBytesIn; return fMsgBytesIn;
} }
virtual uint64_t msgBytesOut() const uint64_t msgBytesOut() const override
{ {
return fMsgBytesOut; return fMsgBytesOut;
} }
@ -479,7 +477,6 @@ class pColScanStep : public JobStep
return fFilters; return fFilters;
} }
private: private:
// defaults okay? // defaults okay?
// pColScanStep(const pColScanStep& rhs); // pColScanStep(const pColScanStep& rhs);
@ -545,16 +542,14 @@ class pDictionaryStep : public JobStep
pDictionaryStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tabelOid, pDictionaryStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tabelOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo); const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
virtual ~pDictionaryStep() ~pDictionaryStep() override = default;
{
}
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
virtual void run() void run() override
{ {
} }
virtual void join() void join() override
{ {
} }
// void setOutList(StringDataList* rids); // void setOutList(StringDataList* rids);
@ -568,7 +563,7 @@ class pDictionaryStep : public JobStep
fBOP = b; fBOP = b;
} }
virtual const std::string toString() const; const std::string toString() const override;
execplan::CalpontSystemCatalog::ColType& colType() execplan::CalpontSystemCatalog::ColType& colType()
{ {
@ -579,23 +574,23 @@ class pDictionaryStep : public JobStep
return fColType; return fColType;
} }
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
virtual uint64_t msgsRcvdCount() const uint64_t msgsRcvdCount() const override
{ {
return msgsRecvd; return msgsRecvd;
} }
virtual uint64_t msgBytesIn() const uint64_t msgBytesIn() const override
{ {
return fMsgBytesIn; return fMsgBytesIn;
} }
virtual uint64_t msgBytesOut() const uint64_t msgBytesOut() const override
{ {
return fMsgBytesOut; return fMsgBytesOut;
} }
@ -677,18 +672,18 @@ class pDictionaryScan : public JobStep
pDictionaryScan(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid, pDictionaryScan(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo); const execplan::CalpontSystemCatalog::ColType& ct, const JobInfo& jobInfo);
~pDictionaryScan(); ~pDictionaryScan() override;
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
virtual void run(); void run() override;
virtual void join(); void join() override;
void setInputList(DataList_t* rids); void setInputList(DataList_t* rids);
void setBOP(int8_t b); void setBOP(int8_t b);
void sendPrimitiveMessages(); void sendPrimitiveMessages();
void receivePrimitiveMessages(); void receivePrimitiveMessages();
void setSingleThread(); void setSingleThread();
virtual const std::string toString() const; const std::string toString() const override;
void setRidList(DataList<ElementType>* rids); void setRidList(DataList<ElementType>* rids);
@ -713,32 +708,32 @@ class pDictionaryScan : public JobStep
fDec->addQueue(uniqueID); fDec->addQueue(uniqueID);
} }
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
uint64_t phyIOCount() const uint64_t phyIOCount() const override
{ {
return fPhysicalIO; return fPhysicalIO;
} }
uint64_t cacheIOCount() const uint64_t cacheIOCount() const override
{ {
return fCacheIO; return fCacheIO;
} }
uint64_t msgsRcvdCount() const uint64_t msgsRcvdCount() const override
{ {
return msgsRecvd; return msgsRecvd;
} }
uint64_t msgBytesIn() const uint64_t msgBytesIn() const override
{ {
return fMsgBytesIn; return fMsgBytesIn;
} }
uint64_t msgBytesOut() const uint64_t msgBytesOut() const override
{ {
return fMsgBytesOut; return fMsgBytesOut;
} }
@ -781,7 +776,7 @@ class pDictionaryScan : public JobStep
} }
void appendFilter(const messageqcpp::ByteStream& filter, unsigned count); void appendFilter(const messageqcpp::ByteStream& filter, unsigned count);
virtual void abort(); void abort() override;
const execplan::CalpontSystemCatalog::ColType& colType() const const execplan::CalpontSystemCatalog::ColType& colType() const
{ {
@ -859,7 +854,7 @@ class pDictionaryScan : public JobStep
class BatchPrimitive : public JobStep, public DECEventListener class BatchPrimitive : public JobStep, public DECEventListener
{ {
public: public:
BatchPrimitive(const JobInfo& jobInfo) : JobStep(jobInfo) explicit BatchPrimitive(const JobInfo& jobInfo) : JobStep(jobInfo)
{ {
} }
virtual bool getFeederFlag() const = 0; virtual bool getFeederFlag() const = 0;
@ -922,20 +917,20 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
TupleBPS(const pDictionaryStep& rhs, const JobInfo& jobInfo); TupleBPS(const pDictionaryStep& rhs, const JobInfo& jobInfo);
TupleBPS(const pDictionaryScan& rhs, const JobInfo& jobInfo); TupleBPS(const pDictionaryScan& rhs, const JobInfo& jobInfo);
TupleBPS(const PassThruStep& rhs, const JobInfo& jobInfo); TupleBPS(const PassThruStep& rhs, const JobInfo& jobInfo);
virtual ~TupleBPS(); ~TupleBPS() override;
/** @brief Starts processing. /** @brief Starts processing.
* *
* Starts processing. * Starts processing.
*/ */
virtual void run(); void run() override;
/** @brief Sync's the caller with the end of execution. /** @brief Sync's the caller with the end of execution.
* *
* Does nothing. Returns when this instance is finished. * Does nothing. Returns when this instance is finished.
*/ */
virtual void join(); void join() override;
void abort(); void abort() override;
void abort_nolock(); void abort_nolock();
/** @brief The main loop for the send-side thread /** @brief The main loop for the send-side thread
@ -960,11 +955,11 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
* Add a filter when the column is anything but a 4-byte float type, including * Add a filter when the column is anything but a 4-byte float type, including
* 8-byte doubles. * 8-byte doubles.
*/ */
void setBPP(JobStep* jobStep); void setBPP(JobStep* jobStep) override;
void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2); void setProjectBPP(JobStep* jobStep1, JobStep* jobStep2) override;
bool scanit(uint64_t rid); bool scanit(uint64_t rid);
void storeCasualPartitionInfo(const bool estimateRowCounts); void storeCasualPartitionInfo(const bool estimateRowCounts);
bool getFeederFlag() const bool getFeederFlag() const override
{ {
return isFilterFeeder; return isFilterFeeder;
} }
@ -972,7 +967,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{ {
isFilterFeeder = filterFeeder; isFilterFeeder = filterFeeder;
} }
void setSwallowRows(const bool swallowRows) void setSwallowRows(const bool swallowRows) override
{ {
fSwallowRows = swallowRows; fSwallowRows = swallowRows;
} }
@ -982,25 +977,25 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
} }
/* Base class interface fcn that can go away */ /* Base class interface fcn that can go away */
void setOutputType(BPSOutputType) void setOutputType(BPSOutputType) override
{ {
} // Can't change the ot of a TupleBPS } // Can't change the ot of a TupleBPS
BPSOutputType getOutputType() const BPSOutputType getOutputType() const override
{ {
return ROW_GROUP; return ROW_GROUP;
} }
void setBppStep() void setBppStep() override
{ {
} }
void setIsProjectionOnly() void setIsProjectionOnly() override
{ {
} }
uint64_t getRows() const uint64_t getRows() const override
{ {
return ridsReturned; return ridsReturned;
} }
void setFirstStepType(PrimitiveStepType firstStepType) void setFirstStepType(PrimitiveStepType firstStepType) override
{ {
ffirstStepType = firstStepType; ffirstStepType = firstStepType;
} }
@ -1008,19 +1003,19 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{ {
return ffirstStepType; return ffirstStepType;
} }
void setStepCount() void setStepCount() override
{ {
fStepCount++; fStepCount++;
} }
uint32_t getStepCount() const uint32_t getStepCount() const override
{ {
return fStepCount; return fStepCount;
} }
void setLastTupleId(uint64_t id) void setLastTupleId(uint64_t id) override
{ {
fLastTupleId = id; fLastTupleId = id;
} }
uint64_t getLastTupleId() const uint64_t getLastTupleId() const override
{ {
return fLastTupleId; return fLastTupleId;
} }
@ -1029,20 +1024,20 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
* *
* Set the DistributedEngineComm object this instance should use * Set the DistributedEngineComm object this instance should use
*/ */
void dec(DistributedEngineComm* dec); void dec(DistributedEngineComm* dec) override;
virtual void stepId(uint16_t stepId); void stepId(uint16_t stepId) override;
virtual uint16_t stepId() const uint16_t stepId() const override
{ {
return fStepId; return fStepId;
} }
virtual const std::string toString() const; const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -1050,40 +1045,40 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
{ {
return fColType; return fColType;
} }
const OIDVector& getProjectOids() const const OIDVector& getProjectOids() const override
{ {
return projectOids; return projectOids;
} }
virtual uint64_t phyIOCount() const uint64_t phyIOCount() const override
{ {
return fPhysicalIO; return fPhysicalIO;
} }
virtual uint64_t cacheIOCount() const uint64_t cacheIOCount() const override
{ {
return fCacheIO; return fCacheIO;
} }
virtual uint64_t msgsRcvdCount() const uint64_t msgsRcvdCount() const override
{ {
return msgsRecvd; return msgsRecvd;
} }
virtual uint64_t msgBytesIn() const uint64_t msgBytesIn() const override
{ {
return fMsgBytesIn; return fMsgBytesIn;
} }
virtual uint64_t msgBytesOut() const uint64_t msgBytesOut() const override
{ {
return fMsgBytesOut; return fMsgBytesOut;
} }
virtual uint64_t blockTouched() const uint64_t blockTouched() const override
{ {
return fBlockTouched; return fBlockTouched;
} }
uint32_t nextBand(messageqcpp::ByteStream& bs); uint32_t nextBand(messageqcpp::ByteStream& bs) override;
//...Currently only supported by pColStep and pColScanStep, so didn't bother //...Currently only supported by pColStep and pColScanStep, so didn't bother
//...to define abstract method in base class, but if start adding to other //...to define abstract method in base class, but if start adding to other
//...classes, then should consider adding pure virtual method to JobStep. //...classes, then should consider adding pure virtual method to JobStep.
uint64_t blksSkipped() const uint64_t blksSkipped() const override
{ {
return fNumBlksSkipped; return fNumBlksSkipped;
} }
@ -1094,17 +1089,17 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
} }
void useJoiner(std::shared_ptr<joiner::TupleJoiner>); void useJoiner(std::shared_ptr<joiner::TupleJoiner>);
void useJoiners(const std::vector<std::shared_ptr<joiner::TupleJoiner>>&); void useJoiners(const std::vector<std::shared_ptr<joiner::TupleJoiner>>&);
bool wasStepRun() const bool wasStepRun() const override
{ {
return fRunExecuted; return fRunExecuted;
} }
// DEC event listener interface // DEC event listener interface
void newPMOnline(uint32_t connectionNumber); void newPMOnline(uint32_t connectionNumber) override;
void setInputRowGroup(const rowgroup::RowGroup& rg); void setInputRowGroup(const rowgroup::RowGroup& rg);
void setOutputRowGroup(const rowgroup::RowGroup& rg); void setOutputRowGroup(const rowgroup::RowGroup& rg) override;
const rowgroup::RowGroup& getOutputRowGroup() const; const rowgroup::RowGroup& getOutputRowGroup() const override;
void setAggregateStep(const rowgroup::SP_ROWAGG_PM_t& agg, const rowgroup::RowGroup& rg); void setAggregateStep(const rowgroup::SP_ROWAGG_PM_t& agg, const rowgroup::RowGroup& rg);
@ -1118,7 +1113,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
return bop; return bop;
} }
void setJobInfo(const JobInfo* jobInfo); void setJobInfo(const JobInfo* jobInfo) override;
// @bug 2123. Added getEstimatedRowCount function. // @bug 2123. Added getEstimatedRowCount function.
/* @brief estimates the number of rows that will be returned for use in determining the /* @brief estimates the number of rows that will be returned for use in determining the
@ -1141,9 +1136,9 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
JLF should register that object with the TBPS for that table. If it's JLF should register that object with the TBPS for that table. If it's
cross-table, then JLF should register it with the join step. cross-table, then JLF should register it with the join step.
*/ */
void addFcnJoinExp(const std::vector<execplan::SRCP>& fe); void addFcnJoinExp(const std::vector<execplan::SRCP>& fe) override;
void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>& fe); void addFcnExpGroup1(const boost::shared_ptr<execplan::ParseTree>& fe) override;
void setFE1Input(const rowgroup::RowGroup& feInput); void setFE1Input(const rowgroup::RowGroup& feInput) override;
/* for use by the THJS only... */ /* for use by the THJS only... */
void setFcnExpGroup2(const boost::shared_ptr<funcexp::FuncExpWrapper>& fe2, void setFcnExpGroup2(const boost::shared_ptr<funcexp::FuncExpWrapper>& fe2,
@ -1152,17 +1147,17 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
/* Functions & Expressions in select and groupby clause. /* Functions & Expressions in select and groupby clause.
JLF should use these only if there isn't a join. If there is, call the JLF should use these only if there isn't a join. If there is, call the
equivalent fcn on THJS instead */ equivalent fcn on THJS instead */
void setFcnExpGroup3(const std::vector<execplan::SRCP>& fe); void setFcnExpGroup3(const std::vector<execplan::SRCP>& fe) override;
void setFE23Output(const rowgroup::RowGroup& rg); void setFE23Output(const rowgroup::RowGroup& rg) override;
bool hasFcnExpGroup3() bool hasFcnExpGroup3()
{ {
return (fe2 != NULL); return (fe2 != NULL);
} }
// rowgroup to connector // rowgroup to connector
const rowgroup::RowGroup& getDeliveredRowGroup() const; const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b); void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const; bool deliverStringTableRowGroup() const override;
/* Interface for adding add'l predicates for casual partitioning. /* Interface for adding add'l predicates for casual partitioning.
* This fcn checks for any intersection between the values in vals * This fcn checks for any intersection between the values in vals
@ -1185,7 +1180,7 @@ class TupleBPS : public BatchPrimitive, public TupleDeliveryStep
void reloadExtentLists(); void reloadExtentLists();
void initExtentMarkers(); // need a better name for this void initExtentMarkers(); // need a better name for this
virtual bool stringTableFriendly() bool stringTableFriendly() override
{ {
return true; return true;
} }
@ -1486,16 +1481,16 @@ class FilterStep : public JobStep
{ {
public: public:
FilterStep(const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo); FilterStep(const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo);
~FilterStep(); ~FilterStep() override;
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
void run(); void run() override;
void join(); void join() override;
const std::string toString() const; const std::string toString() const override;
execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOID; return fTableOID;
} }
@ -1526,7 +1521,7 @@ class FilterStep : public JobStep
private: private:
// This i/f is not meaningful in this step // This i/f is not meaningful in this step
execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return 0; return 0;
} }
@ -1562,31 +1557,31 @@ class PassThruStep : public JobStep
PassThruStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid, PassThruStep(execplan::CalpontSystemCatalog::OID oid, execplan::CalpontSystemCatalog::OID tableOid,
const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo); const execplan::CalpontSystemCatalog::ColType& colType, const JobInfo& jobInfo);
PassThruStep(const pColStep& rhs); explicit PassThruStep(const pColStep& rhs);
PassThruStep(const PseudoColStep& rhs); explicit PassThruStep(const PseudoColStep& rhs);
virtual ~PassThruStep(); ~PassThruStep() override;
/** @brief Starts processing. Set at least the RID list before calling. /** @brief Starts processing. Set at least the RID list before calling.
* *
* Starts processing. Set at least the RID list before calling this. * Starts processing. Set at least the RID list before calling this.
*/ */
virtual void run(); void run() override;
/** @brief Sync's the caller with the end of execution. /** @brief Sync's the caller with the end of execution.
* *
* Does nothing. Returns when this instance is finished. * Does nothing. Returns when this instance is finished.
*/ */
virtual void join(); void join() override;
virtual const std::string toString() const; const std::string toString() const override;
virtual execplan::CalpontSystemCatalog::OID oid() const execplan::CalpontSystemCatalog::OID oid() const override
{ {
return fOid; return fOid;
} }
virtual execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -1595,7 +1590,7 @@ class PassThruStep : public JobStep
{ {
return colWidth; return colWidth;
} }
bool isDictCol() const bool isDictCol() const override
{ {
return isDictColumn; return isDictColumn;
} }
@ -1663,13 +1658,11 @@ class PseudoColStep : public pColStep
{ {
} }
PseudoColStep(const PassThruStep& rhs) : pColStep(rhs), fPseudoColumnId(rhs.pseudoType()) explicit PseudoColStep(const PassThruStep& rhs) : pColStep(rhs), fPseudoColumnId(rhs.pseudoType())
{ {
} }
virtual ~PseudoColStep() ~PseudoColStep() override = default;
{
}
uint32_t pseudoColumnId() const uint32_t pseudoColumnId() const
{ {
@ -1686,8 +1679,8 @@ class PseudoColStep : public pColStep
private: private:
/** @brief disabled constuctor /** @brief disabled constuctor
*/ */
PseudoColStep(const pColScanStep&); explicit PseudoColStep(const pColScanStep&);
PseudoColStep(const pColStep&); explicit PseudoColStep(const pColStep&);
}; };
} // namespace joblist } // namespace joblist

View File

@ -24,12 +24,12 @@ namespace joblist
class PseudoCCJL : public ColumnCommandJL class PseudoCCJL : public ColumnCommandJL
{ {
public: public:
PseudoCCJL(const PseudoColStep&); explicit PseudoCCJL(const PseudoColStep&);
virtual ~PseudoCCJL(); ~PseudoCCJL() override;
virtual void createCommand(messageqcpp::ByteStream&) const; void createCommand(messageqcpp::ByteStream&) const override;
virtual void runCommand(messageqcpp::ByteStream&) const; void runCommand(messageqcpp::ByteStream&) const override;
virtual std::string toString(); std::string toString() override;
uint32_t getFunction() const uint32_t getFunction() const
{ {
return function; return function;

View File

@ -58,7 +58,7 @@ extern const unsigned maxSessionsDefault;
class LockedSessionMap class LockedSessionMap
{ {
public: public:
LockedSessionMap(uint64_t resource, unsigned maxSessions = maxSessionsDefault) explicit LockedSessionMap(uint64_t resource, unsigned maxSessions = maxSessionsDefault)
: fResourceBlock(resource), fMaxSessions(maxSessions) : fResourceBlock(resource), fMaxSessions(maxSessions)
{ {
} }
@ -93,9 +93,7 @@ class ResourceDistributor
{ {
} }
virtual ~ResourceDistributor() virtual ~ResourceDistributor() = default;
{
}
typedef std::map<uint32_t, uint64_t> SessionMap; typedef std::map<uint32_t, uint64_t> SessionMap;

View File

@ -100,9 +100,9 @@ const uint64_t defaultRowsPerBatch = 10000;
/* HJ CP feedback, see bug #1465 */ /* HJ CP feedback, see bug #1465 */
const uint32_t defaultHjCPUniqueLimit = 100; const uint32_t defaultHjCPUniqueLimit = 100;
const constexpr uint64_t defaultFlowControlEnableBytesThresh = 50000000; // ~50Mb const constexpr uint64_t defaultFlowControlEnableBytesThresh = 50000000; // ~50Mb
const constexpr uint64_t defaultFlowControlDisableBytesThresh = 10000000; // ~10 MB const constexpr uint64_t defaultFlowControlDisableBytesThresh = 10000000; // ~10 MB
const constexpr uint64_t defaultBPPSendThreadBytesThresh = 250000000; // ~250 MB const constexpr uint64_t defaultBPPSendThreadBytesThresh = 250000000; // ~250 MB
const constexpr uint64_t BPPSendThreadMsgThresh = 100; const constexpr uint64_t BPPSendThreadMsgThresh = 100;
const bool defaultAllowDiskAggregation = false; const bool defaultAllowDiskAggregation = false;
@ -117,7 +117,7 @@ class ResourceManager
/** @brief ctor /** @brief ctor
* *
*/ */
ResourceManager(bool runningInExeMgr = false, config::Config* aConfig = nullptr); explicit ResourceManager(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
static ResourceManager* instance(bool runningInExeMgr = false, config::Config* aConfig = nullptr); static ResourceManager* instance(bool runningInExeMgr = false, config::Config* aConfig = nullptr);
config::Config* getConfig() config::Config* getConfig()
{ {
@ -126,9 +126,7 @@ class ResourceManager
/** @brief dtor /** @brief dtor
*/ */
virtual ~ResourceManager() virtual ~ResourceManager() = default;
{
}
typedef std::map<uint32_t, uint64_t> MemMap; typedef std::map<uint32_t, uint64_t> MemMap;
@ -286,12 +284,14 @@ class ResourceManager
uint64_t getDECEnableBytesThresh() const uint64_t getDECEnableBytesThresh() const
{ {
return getUintVal(FlowControlStr, "DECFlowControlEnableBytesThresh(", defaultFlowControlEnableBytesThresh); return getUintVal(FlowControlStr, "DECFlowControlEnableBytesThresh(",
defaultFlowControlEnableBytesThresh);
} }
uint32_t getDECDisableBytesThresh() const uint32_t getDECDisableBytesThresh() const
{ {
return getUintVal(FlowControlStr, "DECFlowControlDisableBytesThresh", defaultFlowControlDisableBytesThresh); return getUintVal(FlowControlStr, "DECFlowControlDisableBytesThresh",
defaultFlowControlDisableBytesThresh);
} }
uint32_t getBPPSendThreadBytesThresh() const uint32_t getBPPSendThreadBytesThresh() const

View File

@ -42,24 +42,25 @@ class RTSCommandJL : public CommandJL
public: public:
RTSCommandJL(const pColStep&, const pDictionaryStep&); RTSCommandJL(const pColStep&, const pDictionaryStep&);
RTSCommandJL(const PassThruStep&, const pDictionaryStep&); RTSCommandJL(const PassThruStep&, const pDictionaryStep&);
virtual ~RTSCommandJL(); ~RTSCommandJL() override;
void setLBID(uint64_t data, uint32_t dbroot); // converts a rid or dictionary token to an LBID. For void setLBID(uint64_t data,
// ColumnCommandJL it's a RID, for a DictStep it's a token. uint32_t dbroot) override; // converts a rid or dictionary token to an LBID. For
uint8_t getTableColumnType(); // ColumnCommandJL it's a RID, for a DictStep it's a token.
std::string toString(); uint8_t getTableColumnType() override;
std::string toString() override;
bool isPassThru() bool isPassThru()
{ {
return (passThru != 0); return (passThru != 0);
} }
uint16_t getWidth(); uint16_t getWidth() override;
CommandType getCommandType() CommandType getCommandType() override
{ {
return RID_TO_STRING; return RID_TO_STRING;
} }
void createCommand(messageqcpp::ByteStream&) const; void createCommand(messageqcpp::ByteStream&) const override;
void runCommand(messageqcpp::ByteStream&) const; void runCommand(messageqcpp::ByteStream&) const override;
private: private:
RTSCommandJL(); RTSCommandJL();

View File

@ -40,28 +40,28 @@ class SubQueryStep : public JobStep
public: public:
/** @brief SubQueryStep constructor /** @brief SubQueryStep constructor
*/ */
SubQueryStep(const JobInfo&); explicit SubQueryStep(const JobInfo&);
/** @brief SubQueryStep destructor /** @brief SubQueryStep destructor
*/ */
~SubQueryStep(); ~SubQueryStep() override;
/** @brief virtual void run method /** @brief virtual void run method
*/ */
void run(); void run() override;
/** @brief virtual void join method /** @brief virtual void join method
*/ */
void join(); void join() override;
/** @brief virtual void abort method /** @brief virtual void abort method
*/ */
void abort(); void abort() override;
/** @brief virtual get table OID /** @brief virtual get table OID
* @returns OID * @returns OID
*/ */
execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -76,7 +76,7 @@ class SubQueryStep : public JobStep
/** @brief virtual output info to a string /** @brief virtual output info to a string
* @returns string * @returns string
*/ */
const std::string toString() const; const std::string toString() const override;
/** @brief virtual set the output rowgroup /** @brief virtual set the output rowgroup
*/ */
@ -128,24 +128,24 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief SubAdapterStep destructor /** @brief SubAdapterStep destructor
*/ */
~SubAdapterStep(); ~SubAdapterStep() override;
/** @brief virtual void run method /** @brief virtual void run method
*/ */
void run(); void run() override;
/** @brief virtual void join method /** @brief virtual void join method
*/ */
void join(); void join() override;
/** @brief virtual void abort method /** @brief virtual void abort method
*/ */
void abort(); void abort() override;
/** @brief virtual get table OID /** @brief virtual get table OID
* @returns OID * @returns OID
*/ */
execplan::CalpontSystemCatalog::OID tableOid() const execplan::CalpontSystemCatalog::OID tableOid() const override
{ {
return fTableOid; return fTableOid;
} }
@ -160,16 +160,16 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief virtual output info to a string /** @brief virtual output info to a string
* @returns string * @returns string
*/ */
const std::string toString() const; const std::string toString() const override;
/** @brief virtual set the output rowgroup /** @brief virtual set the output rowgroup
*/ */
void setOutputRowGroup(const rowgroup::RowGroup& rg); void setOutputRowGroup(const rowgroup::RowGroup& rg) override;
/** @brief virtual get the output rowgroup /** @brief virtual get the output rowgroup
* @returns RowGroup * @returns RowGroup
*/ */
const rowgroup::RowGroup& getOutputRowGroup() const const rowgroup::RowGroup& getOutputRowGroup() const override
{ {
return fRowGroupOut; return fRowGroupOut;
} }
@ -177,24 +177,24 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
/** @brief TupleDeliveryStep's pure virtual methods nextBand /** @brief TupleDeliveryStep's pure virtual methods nextBand
* @returns row count * @returns row count
*/ */
uint32_t nextBand(messageqcpp::ByteStream& bs); uint32_t nextBand(messageqcpp::ByteStream& bs) override;
/** @brief Delivered Row Group /** @brief Delivered Row Group
* @returns RowGroup * @returns RowGroup
*/ */
const rowgroup::RowGroup& getDeliveredRowGroup() const const rowgroup::RowGroup& getDeliveredRowGroup() const override
{ {
return fRowGroupDeliver; return fRowGroupDeliver;
} }
/** @brief Turn on/off string table delivery /** @brief Turn on/off string table delivery
*/ */
void deliverStringTableRowGroup(bool b); void deliverStringTableRowGroup(bool b) override;
/** @brief Check useStringTable flag on delivered RowGroup /** @brief Check useStringTable flag on delivered RowGroup
* @returns boolean * @returns boolean
*/ */
bool deliverStringTableRowGroup() const; bool deliverStringTableRowGroup() const override;
/** @brief set the rowgroup for FE to work on /** @brief set the rowgroup for FE to work on
*/ */
@ -255,7 +255,7 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
class Runner class Runner
{ {
public: public:
Runner(SubAdapterStep* step) : fStep(step) explicit Runner(SubAdapterStep* step) : fStep(step)
{ {
} }
void operator()() void operator()()
@ -272,4 +272,3 @@ class SubAdapterStep : public JobStep, public TupleDeliveryStep
}; };
} // namespace joblist } // namespace joblist

View File

@ -176,15 +176,15 @@ class SimpleScalarTransformer : public SubQueryTransformer
/** @brief SimpleScalarTransformer constructor /** @brief SimpleScalarTransformer constructor
* @param SubQueryTransformer * @param SubQueryTransformer
*/ */
SimpleScalarTransformer(const SubQueryTransformer& rhs); explicit SimpleScalarTransformer(const SubQueryTransformer& rhs);
/** @brief SimpleScalarTransformer destructor /** @brief SimpleScalarTransformer destructor
*/ */
virtual ~SimpleScalarTransformer(); ~SimpleScalarTransformer() override;
/** @brief virtual void run method /** @brief virtual void run method
*/ */
void run(); void run() override;
/** @brief virtual get scalar result /** @brief virtual get scalar result
* @param jobInfo * @param jobInfo
@ -222,4 +222,3 @@ class SimpleScalarTransformer : public SubQueryTransformer
}; };
} // namespace joblist } // namespace joblist

View File

@ -28,8 +28,6 @@
#include <boost/thread.hpp> #include <boost/thread.hpp>
#include <boost/shared_ptr.hpp> #include <boost/shared_ptr.hpp>
namespace joblist namespace joblist
{ {
struct TSQSize_t struct TSQSize_t
@ -56,7 +54,7 @@ class ThreadSafeQueue
* *
* @warning this class takes ownership of the passed-in pointers. * @warning this class takes ownership of the passed-in pointers.
*/ */
ThreadSafeQueue(boost::mutex* pimplLock = 0, boost::condition* pimplCond = 0) ThreadSafeQueue(boost::mutex* pimplLock = nullptr, boost::condition* pimplCond = nullptr)
: fShutdown(false), bytes(0), zeroCount(0) : fShutdown(false), bytes(0), zeroCount(0)
{ {
fPimplLock.reset(pimplLock); fPimplLock.reset(pimplLock);
@ -113,7 +111,7 @@ class ThreadSafeQueue
*/ */
T& front() T& front()
{ {
if (fPimplLock == 0 || fPimplCond == 0) if (fPimplLock == nullptr || fPimplCond == nullptr)
throw std::runtime_error("TSQ: front(): no sync!"); throw std::runtime_error("TSQ: front(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock); boost::mutex::scoped_lock lk(*fPimplLock);
@ -140,7 +138,7 @@ class ThreadSafeQueue
{ {
TSQSize_t ret = {0, 0}; TSQSize_t ret = {0, 0};
if (fPimplLock == 0 || fPimplCond == 0) if (fPimplLock == nullptr || fPimplCond == nullptr)
throw std::runtime_error("TSQ: push(): no sync!"); throw std::runtime_error("TSQ: push(): no sync!");
if (fShutdown) if (fShutdown)
@ -161,7 +159,7 @@ class ThreadSafeQueue
{ {
TSQSize_t ret = {0, 0}; TSQSize_t ret = {0, 0};
if (fPimplLock == 0) if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: pop(): no sync!"); throw std::runtime_error("TSQ: pop(): no sync!");
if (fShutdown) if (fShutdown)
@ -213,7 +211,7 @@ class ThreadSafeQueue
uint32_t curSize, workSize; uint32_t curSize, workSize;
TSQSize_t ret = {0, 0}; TSQSize_t ret = {0, 0};
if (fPimplLock == 0) if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: pop_some(): no sync!"); throw std::runtime_error("TSQ: pop_some(): no sync!");
t.clear(); t.clear();
@ -268,7 +266,7 @@ class ThreadSafeQueue
*/ */
bool empty() const bool empty() const
{ {
if (fPimplLock == 0) if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: empty(): no sync!"); throw std::runtime_error("TSQ: empty(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock); boost::mutex::scoped_lock lk(*fPimplLock);
@ -281,7 +279,7 @@ class ThreadSafeQueue
{ {
TSQSize_t ret; TSQSize_t ret;
if (fPimplLock == 0) if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: size(): no sync!"); throw std::runtime_error("TSQ: size(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock); boost::mutex::scoped_lock lk(*fPimplLock);
@ -298,15 +296,13 @@ class ThreadSafeQueue
{ {
fShutdown = true; fShutdown = true;
if (fPimplCond != 0) if (fPimplCond != nullptr)
fPimplCond->notify_all(); fPimplCond->notify_all();
return;
} }
void clear() void clear()
{ {
if (fPimplLock == 0) if (fPimplLock == nullptr)
throw std::runtime_error("TSQ: clear(): no sync!"); throw std::runtime_error("TSQ: clear(): no sync!");
boost::mutex::scoped_lock lk(*fPimplLock); boost::mutex::scoped_lock lk(*fPimplLock);
@ -315,7 +311,6 @@ class ThreadSafeQueue
fImpl.pop(); fImpl.pop();
bytes = 0; bytes = 0;
return;
} }
private: private:

View File

@ -33,27 +33,27 @@ class JSTimeStamp
{ {
public: public:
JSTimeStamp(); JSTimeStamp();
~JSTimeStamp(){}; ~JSTimeStamp() = default;
inline void setFirstInsertTime() inline void setFirstInsertTime()
{ {
gettimeofday(&fFirstInsertTime, 0); gettimeofday(&fFirstInsertTime, nullptr);
} }
inline void setLastInsertTime() inline void setLastInsertTime()
{ {
gettimeofday(&fLastInsertTime, 0); gettimeofday(&fLastInsertTime, nullptr);
} }
inline void setEndOfInputTime() inline void setEndOfInputTime()
{ {
gettimeofday(&fEndofInputTime, 0); gettimeofday(&fEndofInputTime, nullptr);
} }
inline void setFirstReadTime() inline void setFirstReadTime()
{ {
gettimeofday(&fFirstReadTime, 0); gettimeofday(&fFirstReadTime, nullptr);
} }
inline void setLastReadTime() inline void setLastReadTime()
{ {
gettimeofday(&fLastReadTime, 0); gettimeofday(&fLastReadTime, nullptr);
} }
inline void setFirstInsertTime(const struct timeval& t) inline void setFirstInsertTime(const struct timeval& t)

View File

@ -103,21 +103,21 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
/** @brief TupleAggregateStep destructor /** @brief TupleAggregateStep destructor
*/ */
~TupleAggregateStep(); ~TupleAggregateStep() override;
/** @brief virtual void Run method /** @brief virtual void Run method
*/ */
void run(); void run() override;
void join(); void join() override;
const std::string toString() const; const std::string toString() const override;
void setOutputRowGroup(const rowgroup::RowGroup&); void setOutputRowGroup(const rowgroup::RowGroup&) override;
const rowgroup::RowGroup& getOutputRowGroup() const; const rowgroup::RowGroup& getOutputRowGroup() const override;
const rowgroup::RowGroup& getDeliveredRowGroup() const; const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b); void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const; bool deliverStringTableRowGroup() const override;
uint32_t nextBand(messageqcpp::ByteStream& bs); uint32_t nextBand(messageqcpp::ByteStream& bs) override;
uint32_t nextBand_singleThread(messageqcpp::ByteStream& bs); uint32_t nextBand_singleThread(messageqcpp::ByteStream& bs);
bool setPmHJAggregation(JobStep* step); bool setPmHJAggregation(JobStep* step);
void savePmHJData(rowgroup::SP_ROWAGG_t&, rowgroup::SP_ROWAGG_t&, rowgroup::RowGroup&); void savePmHJData(rowgroup::SP_ROWAGG_t&, rowgroup::SP_ROWAGG_t&, rowgroup::RowGroup&);
@ -167,9 +167,10 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
template <class GroupByMap> template <class GroupByMap>
static bool tryToFindEqualFunctionColumnByTupleKey(JobInfo& jobInfo, GroupByMap& groupByMap, static bool tryToFindEqualFunctionColumnByTupleKey(JobInfo& jobInfo, GroupByMap& groupByMap,
const uint32_t tupleKey, uint32_t& foundTypleKey); const uint32_t tupleKey, uint32_t& foundTypleKey);
// This functions are workaround for the function above. For some reason different parts of the code with same // This functions are workaround for the function above. For some reason different parts of the code with
// semantics use different containers. // same semantics use different containers.
static uint32_t getTupleKeyFromTuple(const boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*, std::vector<uint32_t>*>& tuple); static uint32_t getTupleKeyFromTuple(
const boost::tuple<uint32_t, int, mcsv1sdk::mcsv1_UDAF*, std::vector<uint32_t>*>& tuple);
static uint32_t getTupleKeyFromTuple(uint32_t key); static uint32_t getTupleKeyFromTuple(uint32_t key);
boost::shared_ptr<execplan::CalpontSystemCatalog> fCatalog; boost::shared_ptr<execplan::CalpontSystemCatalog> fCatalog;
@ -198,7 +199,7 @@ class TupleAggregateStep : public JobStep, public TupleDeliveryStep
class Aggregator class Aggregator
{ {
public: public:
Aggregator(TupleAggregateStep* step) : fStep(step) explicit Aggregator(TupleAggregateStep* step) : fStep(step)
{ {
} }
void operator()() void operator()()

View File

@ -42,30 +42,30 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
public: public:
/** @brief TupleAnnexStep constructor /** @brief TupleAnnexStep constructor
*/ */
TupleAnnexStep(const JobInfo& jobInfo); explicit TupleAnnexStep(const JobInfo& jobInfo);
// Copy ctor to have a class mutex // Copy ctor to have a class mutex
TupleAnnexStep(const TupleAnnexStep& copy); TupleAnnexStep(const TupleAnnexStep& copy);
/** @brief TupleAnnexStep destructor /** @brief TupleAnnexStep destructor
*/ */
~TupleAnnexStep(); ~TupleAnnexStep() override;
// inherited methods // inherited methods
void run(); void run() override;
void join(); void join() override;
const std::string toString() const; const std::string toString() const override;
/** @brief TupleJobStep's pure virtual methods /** @brief TupleJobStep's pure virtual methods
*/ */
const rowgroup::RowGroup& getOutputRowGroup() const; const rowgroup::RowGroup& getOutputRowGroup() const override;
void setOutputRowGroup(const rowgroup::RowGroup&); void setOutputRowGroup(const rowgroup::RowGroup&) override;
/** @brief TupleDeliveryStep's pure virtual methods /** @brief TupleDeliveryStep's pure virtual methods
*/ */
uint32_t nextBand(messageqcpp::ByteStream& bs); uint32_t nextBand(messageqcpp::ByteStream& bs) override;
const rowgroup::RowGroup& getDeliveredRowGroup() const; const rowgroup::RowGroup& getDeliveredRowGroup() const override;
void deliverStringTableRowGroup(bool b); void deliverStringTableRowGroup(bool b) override;
bool deliverStringTableRowGroup() const; bool deliverStringTableRowGroup() const override;
void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo); void initialize(const rowgroup::RowGroup& rgIn, const JobInfo& jobInfo);
@ -95,7 +95,7 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
fMaxThreads = number; fMaxThreads = number;
} }
virtual bool stringTableFriendly() bool stringTableFriendly() override
{ {
return true; return true;
} }
@ -132,7 +132,7 @@ class TupleAnnexStep : public JobStep, public TupleDeliveryStep
class Runner class Runner
{ {
public: public:
Runner(TupleAnnexStep* step) : fStep(step), id(0) explicit Runner(TupleAnnexStep* step) : fStep(step), id(0)
{ {
} }
Runner(TupleAnnexStep* step, uint32_t id) : fStep(step), id(id) Runner(TupleAnnexStep* step, uint32_t id) : fStep(step), id(id)
@ -178,7 +178,7 @@ class reservablePQ : private std::priority_queue<T>
{ {
public: public:
typedef typename std::priority_queue<T>::size_type size_type; typedef typename std::priority_queue<T>::size_type size_type;
reservablePQ(size_type capacity = 0) explicit reservablePQ(size_type capacity = 0)
{ {
reserve(capacity); reserve(capacity);
}; };
@ -193,4 +193,3 @@ class reservablePQ : private std::priority_queue<T>
}; };
} // namespace joblist } // namespace joblist

Some files were not shown because too many files have changed in this diff Show More