mirror of
https://github.com/mangosfour/server.git
synced 2025-12-30 19:37:04 +00:00
[12070] Add some override correctness
This commit is contained in:
parent
835d1c7479
commit
8c93370a19
81 changed files with 513 additions and 510 deletions
|
|
@ -42,13 +42,13 @@ class MANGOS_DLL_SPEC MySqlPreparedStatement : public SqlPreparedStatement
|
|||
~MySqlPreparedStatement();
|
||||
|
||||
// prepare statement
|
||||
virtual bool prepare();
|
||||
virtual bool prepare() override;
|
||||
|
||||
// bind input parameters
|
||||
virtual void bind(const SqlStmtParameters& holder);
|
||||
virtual void bind(const SqlStmtParameters& holder) override;
|
||||
|
||||
// execute DML statement
|
||||
virtual bool execute();
|
||||
virtual bool execute() override;
|
||||
|
||||
protected:
|
||||
// bind parameters
|
||||
|
|
@ -74,20 +74,20 @@ class MANGOS_DLL_SPEC MySQLConnection : public SqlConnection
|
|||
|
||||
//! Initializes Mysql and connects to a server.
|
||||
/*! infoString should be formated like hostname;username;password;database. */
|
||||
bool Initialize(const char* infoString);
|
||||
bool Initialize(const char* infoString) override;
|
||||
|
||||
QueryResult* Query(const char* sql);
|
||||
QueryNamedResult* QueryNamed(const char* sql);
|
||||
bool Execute(const char* sql);
|
||||
QueryResult* Query(const char* sql) override;
|
||||
QueryNamedResult* QueryNamed(const char* sql) override;
|
||||
bool Execute(const char* sql) override;
|
||||
|
||||
unsigned long escape_string(char* to, const char* from, unsigned long length);
|
||||
|
||||
bool BeginTransaction();
|
||||
bool CommitTransaction();
|
||||
bool RollbackTransaction();
|
||||
bool BeginTransaction() override;
|
||||
bool CommitTransaction() override;
|
||||
bool RollbackTransaction() override;
|
||||
|
||||
protected:
|
||||
SqlPreparedStatement* CreateStatement(const std::string& fmt);
|
||||
SqlPreparedStatement* CreateStatement(const std::string& fmt) override;
|
||||
|
||||
private:
|
||||
bool _TransactionCmd(const char* sql);
|
||||
|
|
@ -105,12 +105,12 @@ class MANGOS_DLL_SPEC DatabaseMysql : public Database
|
|||
~DatabaseMysql();
|
||||
|
||||
// must be call before first query in thread
|
||||
void ThreadStart();
|
||||
void ThreadStart() override;
|
||||
// must be call before finish thread run
|
||||
void ThreadEnd();
|
||||
void ThreadEnd() override;
|
||||
|
||||
protected:
|
||||
virtual SqlConnection* CreateConnection();
|
||||
virtual SqlConnection* CreateConnection() override;
|
||||
|
||||
private:
|
||||
static size_t db_count;
|
||||
|
|
|
|||
|
|
@ -40,21 +40,21 @@ class MANGOS_DLL_SPEC PostgreSQLConnection : public SqlConnection
|
|||
PostgreSQLConnection() : mPGconn(NULL) {}
|
||||
~PostgreSQLConnection();
|
||||
|
||||
bool Initialize(const char* infoString);
|
||||
bool Initialize(const char* infoString) override;
|
||||
|
||||
QueryResult* Query(const char* sql);
|
||||
QueryNamedResult* QueryNamed(const char* sql);
|
||||
bool Execute(const char* sql);
|
||||
QueryResult* Query(const char* sql) override;
|
||||
QueryNamedResult* QueryNamed(const char* sql) override;
|
||||
bool Execute(const char* sql) override;
|
||||
|
||||
unsigned long escape_string(char* to, const char* from, unsigned long length);
|
||||
|
||||
bool BeginTransaction();
|
||||
bool CommitTransaction();
|
||||
bool RollbackTransaction();
|
||||
bool BeginTransaction() override;
|
||||
bool CommitTransaction() override;
|
||||
bool RollbackTransaction() override;
|
||||
|
||||
private:
|
||||
bool _TransactionCmd(const char* sql);
|
||||
bool _Query(const char* sql, PGresult** pResult, uint64* pRowCount, uint32* pFieldCount);
|
||||
bool _Query(const char* sql, PGresult** pResult, uint64* pRowCount, uint32* pFieldCount) override;
|
||||
|
||||
PGconn* mPGconn;
|
||||
};
|
||||
|
|
@ -71,7 +71,7 @@ class MANGOS_DLL_SPEC DatabasePostgre : public Database
|
|||
/*! infoString should be formated like hostname;username;password;database. */
|
||||
|
||||
protected:
|
||||
virtual SqlConnection* CreateConnection();
|
||||
virtual SqlConnection* CreateConnection() override;
|
||||
|
||||
private:
|
||||
static size_t db_count;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ class MySQLDelayThread : public SqlDelayThread
|
|||
{
|
||||
public:
|
||||
MySQLDelayThread(Database* db) : SqlDelayThread(db) {}
|
||||
void Stop() { SqlDelayThread::Stop(); }
|
||||
void Stop() { SqlDelayThread::Stop() override; }
|
||||
};
|
||||
#endif //__MYSQLDELAYTHREAD_H
|
||||
|
|
|
|||
|
|
@ -25,6 +25,6 @@ class PGSQLDelayThread : public SqlDelayThread
|
|||
{
|
||||
public:
|
||||
PGSQLDelayThread(Database* db) : SqlDelayThread(db) {}
|
||||
void Stop() { SqlDelayThread::Stop(); }
|
||||
void Stop() { SqlDelayThread::Stop() override; }
|
||||
};
|
||||
#endif //__PGSQLDELAYTHREAD_H
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ class QueryResultMysql : public QueryResult
|
|||
|
||||
~QueryResultMysql();
|
||||
|
||||
bool NextRow();
|
||||
bool NextRow() override;
|
||||
|
||||
private:
|
||||
enum Field::DataTypes ConvertNativeType(enum_field_types mysqlType) const;
|
||||
|
|
|
|||
|
|
@ -78,11 +78,11 @@ class QueryResultPostgre : public QueryResult
|
|||
|
||||
~QueryResultPostgre();
|
||||
|
||||
bool NextRow();
|
||||
bool NextRow() override;
|
||||
|
||||
private:
|
||||
enum Field::DataTypes ConvertNativeType(Oid pOid) const;
|
||||
void EndQuery();
|
||||
void EndQuery() override;
|
||||
|
||||
PGresult* mResult;
|
||||
uint32 mTableIndex;
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ class SqlPlainRequest : public SqlOperation
|
|||
public:
|
||||
SqlPlainRequest(const char* sql) : m_sql(mangos_strdup(sql)) {}
|
||||
~SqlPlainRequest() { char* tofree = const_cast<char*>(m_sql); delete [] tofree; }
|
||||
bool Execute(SqlConnection* conn);
|
||||
bool Execute(SqlConnection* conn) override;
|
||||
};
|
||||
|
||||
class SqlTransaction : public SqlOperation
|
||||
|
|
@ -62,9 +62,9 @@ class SqlTransaction : public SqlOperation
|
|||
SqlTransaction() {}
|
||||
~SqlTransaction();
|
||||
|
||||
void DelayExecute(SqlOperation* sql) { m_queue.push_back(sql); }
|
||||
void DelayExecute(SqlOperation* sql) { m_queue.push_back(sql); }
|
||||
|
||||
bool Execute(SqlConnection* conn);
|
||||
bool Execute(SqlConnection* conn) override;
|
||||
};
|
||||
|
||||
class SqlPreparedRequest : public SqlOperation
|
||||
|
|
@ -73,7 +73,7 @@ class SqlPreparedRequest : public SqlOperation
|
|||
SqlPreparedRequest(int nIndex, SqlStmtParameters* arg);
|
||||
~SqlPreparedRequest();
|
||||
|
||||
bool Execute(SqlConnection* conn);
|
||||
bool Execute(SqlConnection* conn) override;
|
||||
|
||||
private:
|
||||
const int m_nIndex;
|
||||
|
|
@ -105,7 +105,7 @@ class SqlQuery : public SqlOperation
|
|||
SqlQuery(const char* sql, MaNGOS::IQueryCallback* callback, SqlResultQueue* queue)
|
||||
: m_sql(mangos_strdup(sql)), m_callback(callback), m_queue(queue) {}
|
||||
~SqlQuery() { char* tofree = const_cast<char*>(m_sql); delete [] tofree; }
|
||||
bool Execute(SqlConnection* conn);
|
||||
bool Execute(SqlConnection* conn) override;
|
||||
};
|
||||
|
||||
class SqlQueryHolder
|
||||
|
|
@ -134,6 +134,6 @@ class SqlQueryHolderEx : public SqlOperation
|
|||
public:
|
||||
SqlQueryHolderEx(SqlQueryHolder* holder, MaNGOS::IQueryCallback* callback, SqlResultQueue* queue)
|
||||
: m_holder(holder), m_callback(callback), m_queue(queue) {}
|
||||
bool Execute(SqlConnection* conn);
|
||||
bool Execute(SqlConnection* conn) override;
|
||||
};
|
||||
#endif //__SQLOPERATIONS_H
|
||||
|
|
|
|||
|
|
@ -334,12 +334,12 @@ class MANGOS_DLL_SPEC SqlPlainPreparedStatement : public SqlPreparedStatement
|
|||
~SqlPlainPreparedStatement() {}
|
||||
|
||||
// this statement is always prepared
|
||||
virtual bool prepare() { return true; }
|
||||
virtual bool prepare() override { return true; }
|
||||
|
||||
// we should replace all '?' symbols with substrings with proper format
|
||||
virtual void bind(const SqlStmtParameters& holder);
|
||||
virtual void bind(const SqlStmtParameters& holder) override;
|
||||
|
||||
virtual bool execute();
|
||||
virtual bool execute() override;
|
||||
|
||||
protected:
|
||||
void DataToString(const SqlStmtFieldData& data, std::ostringstream& fmt);
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "12069"
|
||||
#define REVISION_NR "12070"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue