aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Database/MySQLConnection.cpp
diff options
context:
space:
mode:
authorVincent_Michael <Vincent_Michael@gmx.de>2013-01-02 14:12:48 +0100
committerVincent_Michael <Vincent_Michael@gmx.de>2013-01-02 14:12:48 +0100
commitb873156c3c1654553319158275f29ac2f818f3ce (patch)
tree204be4b38ee32328a980fe65b46e41336c5a38e8 /src/server/shared/Database/MySQLConnection.cpp
parent05efdaf39349f057eabf58252532dff76511e7ef (diff)
parentebd14b4f01cc64a2a488bdbb1046897cc4da8e9a (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore into mmaps
Conflicts: src/server/game/Movement/Spline/MoveSplineInit.h
Diffstat (limited to 'src/server/shared/Database/MySQLConnection.cpp')
-rw-r--r--src/server/shared/Database/MySQLConnection.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/src/server/shared/Database/MySQLConnection.cpp b/src/server/shared/Database/MySQLConnection.cpp
index acf0d96684c..10ff16b5ddd 100644
--- a/src/server/shared/Database/MySQLConnection.cpp
+++ b/src/server/shared/Database/MySQLConnection.cpp
@@ -63,9 +63,6 @@ MySQLConnection::~MySQLConnection()
for (size_t i = 0; i < m_stmts.size(); ++i)
delete m_stmts[i];
- for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr)
- free((void *)m_queries[itr->first].first);
-
mysql_close(m_Mysql);
}
@@ -150,8 +147,6 @@ bool MySQLConnection::Open()
bool MySQLConnection::PrepareStatements()
{
DoPrepareStatements();
- for (PreparedStatementMap::const_iterator itr = m_queries.begin(); itr != m_queries.end(); ++itr)
- PrepareStatement(itr->first, itr->second.first, itr->second.second);
return !m_prepareError;
}
@@ -424,6 +419,8 @@ MySQLPreparedStatement* MySQLConnection::GetPreparedStatement(uint32 index)
void MySQLConnection::PrepareStatement(uint32 index, const char* sql, ConnectionFlags flags)
{
+ m_queries.insert(PreparedStatementMap::value_type(index, std::make_pair(sql, flags)));
+
// For reconnection case
if (m_reconnecting)
delete m_stmts[index];