mirror of
https://github.com/mangosfour/server.git
synced 2025-12-25 04:37:02 +00:00
Make Mangos Four compatible with newer MySQL. Based by work by @leprasmurf
* Delimite SQL queries for MySQL 8 compatibility * Fix database name for PlayerDump
This commit is contained in:
parent
96e645a61d
commit
fbdc248ed1
57 changed files with 1017 additions and 972 deletions
|
|
@ -231,7 +231,7 @@ void WorldSession::HandleSendMail(WorldPacket& recv_data)
|
|||
else
|
||||
{
|
||||
rc_team = sObjectMgr.GetPlayerTeamByGUID(rc);
|
||||
if (QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM mail WHERE receiver = '%u'", rc.GetCounter()))
|
||||
if (QueryResult* result = CharacterDatabase.PQuery("SELECT COUNT(*) FROM `mail` WHERE `receiver` = '%u'", rc.GetCounter()))
|
||||
{
|
||||
Field* fields = result->Fetch();
|
||||
mails_count = fields[0].GetUInt32();
|
||||
|
|
@ -330,7 +330,7 @@ void WorldSession::HandleSendMail(WorldPacket& recv_data)
|
|||
item->DeleteFromInventoryDB(); // deletes item from character's inventory
|
||||
item->SaveToDB(); // recursive and not have transaction guard into self, item not in inventory and can be save standalone
|
||||
// owner in data will set at mail receive and item extracting
|
||||
CharacterDatabase.PExecute("UPDATE item_instance SET owner_guid = '%u' WHERE guid='%u'", rc.GetCounter(), item->GetGUIDLow());
|
||||
CharacterDatabase.PExecute("UPDATE `item_instance` SET `owner_guid` = '%u' WHERE `guid`='%u'", rc.GetCounter(), item->GetGUIDLow());
|
||||
CharacterDatabase.CommitTransaction();
|
||||
|
||||
draft.AddItem(item);
|
||||
|
|
@ -466,9 +466,9 @@ void WorldSession::HandleMailReturnToSender(WorldPacket& recv_data)
|
|||
// we can return mail now
|
||||
// so firstly delete the old one
|
||||
CharacterDatabase.BeginTransaction();
|
||||
CharacterDatabase.PExecute("DELETE FROM mail WHERE id = '%u'", mailId);
|
||||
CharacterDatabase.PExecute("DELETE FROM `mail` WHERE `id` = '%u'", mailId);
|
||||
// needed?
|
||||
CharacterDatabase.PExecute("DELETE FROM mail_items WHERE mail_id = '%u'", mailId);
|
||||
CharacterDatabase.PExecute("DELETE FROM `mail_items` WHERE `mail_id` = '%u'", mailId);
|
||||
CharacterDatabase.CommitTransaction();
|
||||
pl->RemoveMail(mailId);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue