From c4cac049b4eff3b933d2121ccabf80012f5e90fd Mon Sep 17 00:00:00 2001 From: Machiavelli Date: Sat, 8 Jan 2011 19:07:13 +0100 Subject: Core/DBLayer: Define prepared statements in an array per database instead of explicit calls to MySQL::PrepareStatement. Now the core will show the raw query (without bound arguments) in related log entries instead of PreparedStatement id: X on database Y. --- src/server/shared/Database/MySQLConnection.h | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (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 e7d43d0441e..f96284de5f8 100755 --- a/src/server/shared/Database/MySQLConnection.h +++ b/src/server/shared/Database/MySQLConnection.h @@ -60,6 +60,13 @@ struct MySQLConnectionInfo std::string port_or_socket; }; +struct PreparedStatementTable +{ + uint32 index; + const char* query; + ConnectionFlags type; +}; + class MySQLConnection { template friend class DatabaseWorkerPool; @@ -104,10 +111,11 @@ class MySQLConnection MYSQL* GetHandle() { return m_Mysql; } MySQLPreparedStatement* GetPreparedStatement(uint32 index); - void PrepareStatement(uint32 index, const char* sql, bool async = false); + void PrepareStatement(uint32 index, const char* sql, ConnectionFlags flags); protected: std::vector m_stmts; //! PreparedStatements storage + PreparedStatementTable const * m_statementTable; //! Static index/query pairs bool m_reconnecting; //! Are we reconnecting? private: -- cgit v1.2.3