Core/DBLayer: Added compile time validation for prepared statement indexes passed to DatabaseWorkerPool::GetPreparedStatement turning mistakes like the one fixed in 0327927fa61434d432f9749fd9242ae5dce9a5cd into compiler errors.

(cherry picked from commit 7c75160f590812f0c5d70fd9c68441068e2ded48)

Conflicts:
	src/server/database/Database/Implementation/HotfixDatabase.h
	src/server/database/Database/QueryResult.cpp
	src/server/shared/DataStores/DB2StorageLoader.cpp
	src/server/shared/DataStores/DB2StorageLoader.h
	src/server/shared/DataStores/DB2Store.h
This commit is contained in:
Shauren authored and ariel- committed 2016-01-13 01:38:29 -03:00
1 parent 569c64625d
commit 354c262683
5 files changed
+49 -41

No files matched your search

@@ -21,19 +21,6 @@
#include "DatabaseWorkerPool.h"
#include "MySQLConnection.h"
class CharacterDatabaseConnection : public MySQLConnection
{
public:
//- Constructors for sync and async connections
CharacterDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) { }
CharacterDatabaseConnection(ProducerConsumerQueue<SQLOperation*>* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) { }
//- Loads database type specific prepared statements
void DoPrepareStatements() override;
};
typedef DatabaseWorkerPool<CharacterDatabaseConnection> CharacterDatabaseWorkerPool;
enum CharacterDatabaseStatements
{
/* Naming standard for defines:
@@ -576,4 +563,19 @@ enum CharacterDatabaseStatements
MAX_CHARACTERDATABASE_STATEMENTS
};
class CharacterDatabaseConnection : public MySQLConnection
{
public:
typedef CharacterDatabaseStatements Statements;
//- Constructors for sync and async connections
CharacterDatabaseConnection(MySQLConnectionInfo& connInfo) : MySQLConnection(connInfo) { }
CharacterDatabaseConnection(ProducerConsumerQueue<SQLOperation*>* q, MySQLConnectionInfo& connInfo) : MySQLConnection(q, connInfo) { }
//- Loads database type specific prepared statements
void DoPrepareStatements() override;
};
typedef DatabaseWorkerPool<CharacterDatabaseConnection> CharacterDatabaseWorkerPool;
#endif