1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-30 19:23:07 +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

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

View File

@ -47,33 +47,33 @@ class CommandDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~CommandDMLPackage();
EXPORT ~CommandDMLPackage() override;
/** @brief write a CommandDMLPackage to a ByteStream
*
* @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
*
* @param bytestream the ByteStream to read from
*/
EXPORT int read(messageqcpp::ByteStream& bytestream);
EXPORT int read(messageqcpp::ByteStream& bytestream) override;
/** @brief do nothing
*
* @param buffer
* @param columns the number of columns 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;
};
/** @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
*
@ -81,7 +81,7 @@ class CommandDMLPackage : public CalpontDMLPackage
* @param rows the number of rows in the buffer
*/
int buildFromMysqlBuffer(ColNameList& colNameList, TableValuesMap& tableValuesMap, int columns, int rows,
NullValuesBitset& nullValues)
NullValuesBitset& nullValues) override
{
return 1;
};

View File

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

View File

@ -52,27 +52,27 @@ class DMLColumn : public DMLObject
uint32_t funcScale = 0, bool isNULL = false);
/** @brief new ctor
*
*
*/
EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false,
uint32_t funcScale = 0, bool isNULL = false);
EXPORT DMLColumn(std::string name, utils::NullString& value, bool isFromCol = false, uint32_t funcScale = 0,
bool isNULL = false);
/** @brief dtor
*/
EXPORT ~DMLColumn();
EXPORT ~DMLColumn() override;
/** @brief read a DMLColumn from a ByteStream
*
* @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
*
* @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
*/

View File

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

View File

@ -44,7 +44,7 @@ class DMLTable : public DMLObject
/** @brief dtor
*/
~DMLTable();
~DMLTable() override;
/** @brief get the schema name
*/
@ -85,7 +85,7 @@ class DMLTable : public DMLObject
*
* @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
*
@ -103,7 +103,7 @@ class DMLTable : public DMLObject
*
* @param bytestream the ByteStream to write to
*/
int write(messageqcpp::ByteStream& bytestream);
int write(messageqcpp::ByteStream& bytestream) override;
protected:
private:

View File

@ -53,19 +53,19 @@ class InsertDMLPackage : public CalpontDMLPackage
/** @brief dtor
*/
EXPORT virtual ~InsertDMLPackage();
EXPORT ~InsertDMLPackage() override;
/** @brief write a InsertDMLPackage to a ByteStream
*
* @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
*
* @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
*
@ -85,7 +85,7 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param columns the number of columns 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
*
@ -95,13 +95,13 @@ class InsertDMLPackage : public CalpontDMLPackage
* @param rows number of rows to be touched
*/
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
*
* @param sqlStmt the InsertSqlStatement
*/
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement);
EXPORT int buildFromSqlStatement(SqlStatement& sqlStatement) override;
/** @brief Dump the InsertDMLPackage for debugging purposes
*/

View File

@ -45,7 +45,7 @@ class Row : public DMLObject
/** @brief dtor
*/
EXPORT ~Row();
EXPORT ~Row() override;
/** @brief copy constructor
*/
@ -55,13 +55,13 @@ class Row : public DMLObject
*
* @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
*
* @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
*/

View File

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

View File

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