mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/DBLayer:
- Add basic prepared statement interface (without implementation and thus without testing, without resultset support). - Based on raczman/Albator´s work on TrinityCore3 Build: - Add sLog define ¨hack¨ in DatbaseWorkerPool.h to fix some more sLog errors temporarily FYI: Builds on windows --HG-- branch : trunk
This commit is contained in:
@@ -20,6 +20,8 @@
|
||||
#define _MYSQLCONNECTION_H
|
||||
|
||||
class DatabaseWorker;
|
||||
class PreparedStatement;
|
||||
class MySQLPreparedStatement;
|
||||
|
||||
class MySQLConnection
|
||||
{
|
||||
@@ -34,6 +36,7 @@ class MySQLConnection
|
||||
|
||||
public:
|
||||
bool Execute(const char* sql);
|
||||
bool Execute(PreparedStatement* stmt);
|
||||
QueryResult_AutoPtr Query(const char* sql);
|
||||
bool _Query(const char *sql, MYSQL_RES **pResult, MYSQL_FIELD **pFields, uint64* pRowCount, uint32* pFieldCount);
|
||||
|
||||
@@ -45,12 +48,15 @@ class MySQLConnection
|
||||
|
||||
protected:
|
||||
MYSQL* GetHandle() { return m_Mysql; }
|
||||
MySQLPreparedStatement* GetPreparedStatement(uint32 index);
|
||||
void PrepareStatement(uint32 index, const char* sql);
|
||||
|
||||
private:
|
||||
ACE_Activation_Queue* m_queue; //! Queue shared with other asynchroneous connections.
|
||||
DatabaseWorker* m_worker; //! Core worker task.
|
||||
MYSQL * m_Mysql; //! MySQL Handle.
|
||||
ACE_Thread_Mutex m_Mutex;
|
||||
std::vector<MySQLPreparedStatement*> m_stmts; //! PreparedStatements storage
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user