aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.h
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-09-02 20:54:43 +0200
committerMachiavelli <none@none>2010-09-02 20:54:43 +0200
commit1198591bacb3a80bbe0f57c8fc7d8b883b1a5ecd (patch)
treeafed62f085f6271d6cb5ede9647475d6b502ec82 /src/server/shared/Database/MySQLConnection.h
parentcd182a1e8fea18c8c054f586bd369daa5bf085ba (diff)
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
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.h')
-rw-r--r--src/server/shared/Database/MySQLConnection.h6
1 files changed, 6 insertions, 0 deletions
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<MySQLPreparedStatement*> m_stmts; //! PreparedStatements storage
};
#endif \ No newline at end of file