Core/Guild: avoid data integrity problems wrapping delete+insert statements in a transaction
This commit is contained in:
1 parent
ba8791ddcd
commit
b2c17b4881
6 files changed
+171
-143
No files matched your search
@@ -1948,13 +1948,10 @@ void WorldSession::HandleCharFactionOrRaceChange(WorldPacket& recvData)
|
||||
{
|
||||
// Reset guild
|
||||
stmt = CharacterDatabase.GetPreparedStatement(CHAR_SEL_GUILD_MEMBER);
|
||||
|
||||
stmt->setUInt32(0, lowGuid);
|
||||
|
||||
PreparedQueryResult result = CharacterDatabase.Query(stmt);
|
||||
if (result)
|
||||
if (PreparedQueryResult result = CharacterDatabase.Query(stmt))
|
||||
if (Guild* guild = sGuildMgr->GetGuildById((result->Fetch()[0]).GetUInt32()))
|
||||
guild->DeleteMember(factionChangeInfo.Guid, false, false, true);
|
||||
guild->DeleteMember(trans, factionChangeInfo.Guid, false, false, true);
|
||||
|
||||
Player::LeaveAllArenaTeams(factionChangeInfo.Guid);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user