From 1198591bacb3a80bbe0f57c8fc7d8b883b1a5ecd Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Thu, 2 Sep 2010 20:54:43 +0200 Subject: Core/DBLayer: - Add basic prepared statement interface (without implementation and thus without testing, without resultset support). - Based on raczman/Albator´s work on TrinityCore3 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Build: - Add sLog define ¨hack¨ in DatbaseWorkerPool.h to fix some more sLog errors temporarily FYI: Builds on windows --HG-- branch : trunk --- src/server/shared/Database/MySQLConnection.h | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/server/shared/Database/MySQLConnection.h') diff --git a/src/server/shared/Database/MySQLConnection.h b/src/server/shared/Database/MySQLConnection.h index 5e68e9d7516..c0f792b1191 100644 --- a/src/server/shared/Database/MySQLConnection.h +++ b/src/server/shared/Database/MySQLConnection.h @@ -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 m_stmts; //! PreparedStatements storage }; #endif \ No newline at end of file -- cgit v1.2.3