Core/DBLayer: Prevent using prepared statements on wrong database

This commit is contained in:
Shauren
2019-07-27 01:00:37 +02:00
parent 1dcbceba81
commit e8e89f58fb
102 changed files with 604 additions and 577 deletions

View File

@@ -126,7 +126,7 @@ bool RASession::CheckAccessLevel(const std::string& user)
Utf8ToUpperOnlyLatin(safeUser);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS);
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_ACCOUNT_ACCESS);
stmt->setString(0, safeUser);
PreparedQueryResult result = LoginDatabase.Query(stmt);
@@ -162,7 +162,7 @@ bool RASession::CheckPassword(const std::string& user, const std::string& pass)
std::string hash = AccountMgr::CalculateShaPassHash(safe_user, safe_pass);
PreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME);
LoginDatabasePreparedStatement* stmt = LoginDatabase.GetPreparedStatement(LOGIN_SEL_CHECK_PASSWORD_BY_NAME);
stmt->setString(0, safe_user);
stmt->setString(1, hash);