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
@@ -148,7 +148,8 @@ public:
|
||||
return false;
|
||||
|
||||
// player's guild membership checked in AddMember before add
|
||||
return targetGuild->AddMember(targetGuid);
|
||||
SQLTransaction trans(nullptr);
|
||||
return targetGuild->AddMember(trans, targetGuid);
|
||||
}
|
||||
|
||||
static bool HandleGuildUninviteCommand(ChatHandler* handler, char const* args)
|
||||
@@ -166,7 +167,8 @@ public:
|
||||
if (!targetGuild)
|
||||
return false;
|
||||
|
||||
targetGuild->DeleteMember(targetGuid, false, true, true);
|
||||
SQLTransaction trans(nullptr);
|
||||
targetGuild->DeleteMember(trans, targetGuid, false, true, true);
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -193,7 +195,8 @@ public:
|
||||
return false;
|
||||
|
||||
uint8 newRank = uint8(atoi(rankStr));
|
||||
return targetGuild->ChangeMemberRank(targetGuid, newRank);
|
||||
SQLTransaction trans(nullptr);
|
||||
return targetGuild->ChangeMemberRank(trans, targetGuid, newRank);
|
||||
}
|
||||
|
||||
static bool HandleGuildRenameCommand(ChatHandler* handler, char const* _args)
|
||||
|
||||
Reference in new issue
Block a user