diff options
| author | Shauren <shauren.trinity@gmail.com> | 2019-07-27 01:00:37 +0200 |
|---|---|---|
| committer | Shauren <shauren.trinity@gmail.com> | 2019-07-27 01:00:37 +0200 |
| commit | e8e89f58fb800014f53341f12505f60ee2b5fb6f (patch) | |
| tree | 2b63800163e2026be75621a36ddf1218bdbf9dab /src/server/game/Support | |
| parent | 1dcbceba81002ba6ff83129d403763df398f9736 (diff) | |
Core/DBLayer: Prevent using prepared statements on wrong database
Diffstat (limited to 'src/server/game/Support')
| -rw-r--r-- | src/server/game/Support/SupportMgr.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Support/SupportMgr.cpp b/src/server/game/Support/SupportMgr.cpp index 380bf02b14d..e811255e4f3 100644 --- a/src/server/game/Support/SupportMgr.cpp +++ b/src/server/game/Support/SupportMgr.cpp @@ -130,7 +130,7 @@ void BugTicket::LoadFromDB(Field* fields) void BugTicket::SaveToDB() const { uint8 idx = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_BUG); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_BUG); stmt->setUInt32(idx, _id); stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); @@ -148,7 +148,7 @@ void BugTicket::SaveToDB() const void BugTicket::DeleteFromDB() { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_BUG); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_BUG); stmt->setUInt32(0, _id); CharacterDatabase.Execute(stmt); } @@ -228,7 +228,7 @@ void ComplaintTicket::SaveToDB() const SQLTransaction trans = CharacterDatabase.BeginTransaction(); uint8 idx = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_COMPLAINT); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_COMPLAINT); stmt->setUInt32(idx, _id); stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); @@ -267,7 +267,7 @@ void ComplaintTicket::SaveToDB() const void ComplaintTicket::DeleteFromDB() { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_COMPLAINT); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_COMPLAINT); stmt->setUInt32(0, _id); CharacterDatabase.Execute(stmt); @@ -339,7 +339,7 @@ void SuggestionTicket::LoadFromDB(Field* fields) void SuggestionTicket::SaveToDB() const { uint8 idx = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_SUGGESTION); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_REP_GM_SUGGESTION); stmt->setUInt32(idx, _id); stmt->setUInt64(++idx, _playerGuid.GetCounter()); stmt->setString(++idx, _note); @@ -357,7 +357,7 @@ void SuggestionTicket::SaveToDB() const void SuggestionTicket::DeleteFromDB() { - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_SUGGESTION); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_GM_SUGGESTION); stmt->setUInt32(0, _id); CharacterDatabase.Execute(stmt); } @@ -476,7 +476,7 @@ void SupportMgr::LoadBugTickets() _lastBugId = 0; _openBugTicketCount = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_BUGS); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_BUGS); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -516,7 +516,7 @@ void SupportMgr::LoadComplaintTickets() _lastComplaintId = 0; _openComplaintTicketCount = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_COMPLAINTS); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_COMPLAINTS); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -525,7 +525,7 @@ void SupportMgr::LoadComplaintTickets() } uint32 count = 0; - PreparedStatement* chatLogStmt; + CharacterDatabasePreparedStatement* chatLogStmt; PreparedQueryResult chatLogResult; do { @@ -571,7 +571,7 @@ void SupportMgr::LoadSuggestionTickets() _lastSuggestionId = 0; _openSuggestionTicketCount = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_SUGGESTIONS); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GM_SUGGESTIONS); PreparedQueryResult result = CharacterDatabase.Query(stmt); if (!result) { @@ -705,7 +705,7 @@ TC_GAME_API void SupportMgr::ResetTickets<BugTicket>() _lastBugId = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_BUGS); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_BUGS); CharacterDatabase.Execute(stmt); } @@ -733,7 +733,7 @@ TC_GAME_API void SupportMgr::ResetTickets<SuggestionTicket>() _lastSuggestionId = 0; - PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_SUGGESTIONS); + CharacterDatabasePreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_ALL_GM_SUGGESTIONS); CharacterDatabase.Execute(stmt); } |
