Core/DBLayer: Convert PAppend() queries to prepared statements No.1

This commit is contained in:
leak
2012-03-25 16:25:06 +02:00
parent 56fac5e1af
commit c6cbe4c77c
22 changed files with 288 additions and 91 deletions
@@ -496,8 +496,15 @@ void AchievementMgr::ResetAchievementCriteria(AchievementCriteriaTypes type, uin
void AchievementMgr::DeleteFromDB(uint32 lowguid)
{
SQLTransaction trans = CharacterDatabase.BeginTransaction();
trans->PAppend("DELETE FROM character_achievement WHERE guid = %u", lowguid);
trans->PAppend("DELETE FROM character_achievement_progress WHERE guid = %u", lowguid);
PreparedStatement* stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT);
stmt->setUInt32(0, lowguid);
trans->Append(stmt);
stmt = CharacterDatabase.GetPreparedStatement(CHAR_DEL_CHAR_ACHIEVEMENT_PROGRESS);
stmt->setUInt32(0, lowguid);
trans->Append(stmt);
CharacterDatabase.CommitTransaction(trans);
}