mirror of
https://github.com/mangosfour/server.git
synced 2025-12-20 16:37:04 +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
|
|
@ -101,7 +101,7 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s
|
|||
// search by GUID
|
||||
if (isNumeric(searchString))
|
||||
{
|
||||
resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND guid = %u", uint32(atoi(searchString.c_str())));
|
||||
resultChar = CharacterDatabase.PQuery("SELECT `guid`, `deleteInfos_Name`, `deleteInfos_Account`, `deleteDate` FROM `characters` WHERE `deleteDate` IS NOT NULL AND `guid` = %u", uint32(atoi(searchString.c_str())));
|
||||
}
|
||||
// search by name
|
||||
else
|
||||
|
|
@ -111,12 +111,12 @@ bool ChatHandler::GetDeletedCharacterInfoList(DeletedInfoList& foundList, std::s
|
|||
return false;
|
||||
}
|
||||
|
||||
resultChar = CharacterDatabase.PQuery("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL AND deleteInfos_Name " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'"), searchString.c_str());
|
||||
resultChar = CharacterDatabase.PQuery("SELECT `guid`, `deleteInfos_Name`, `deleteInfos_Account`, `deleteDate` FROM `characters` WHERE `deleteDate` IS NOT NULL AND `deleteInfos_Name` " _LIKE_ " " _CONCAT3_("'%%'", "'%s'", "'%%'"), searchString.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
resultChar = CharacterDatabase.Query("SELECT guid, deleteInfos_Name, deleteInfos_Account, deleteDate FROM characters WHERE deleteDate IS NOT NULL");
|
||||
resultChar = CharacterDatabase.Query("SELECT `guid`, `deleteInfos_Name`, `deleteInfos_Account`, `deleteDate` FROM `characters` WHERE `deleteDate` IS NOT NULL");
|
||||
}
|
||||
|
||||
if (resultChar)
|
||||
|
|
@ -277,7 +277,7 @@ void ChatHandler::HandleCharacterDeletedRestoreHelper(DeletedInfo const& delInfo
|
|||
return;
|
||||
}
|
||||
|
||||
CharacterDatabase.PExecute("UPDATE characters SET name='%s', account='%u', deleteDate=NULL, deleteInfos_Name=NULL, deleteInfos_Account=NULL WHERE deleteDate IS NOT NULL AND guid = %u",
|
||||
CharacterDatabase.PExecute("UPDATE `characters` SET `name`='%s', `account`='%u', `deleteDate`=NULL, `deleteInfos_Name`=NULL, `deleteInfos_Account`=NULL WHERE `deleteDate` IS NOT NULL AND `guid` = %u",
|
||||
delInfo.name.c_str(), delInfo.accountId, delInfo.lowguid);
|
||||
}
|
||||
|
||||
|
|
@ -489,7 +489,7 @@ bool ChatHandler::HandleAccountOnlineListCommand(char* args)
|
|||
|
||||
///- Get the list of accounts ID logged to the realm
|
||||
// 0 1 2 3 4
|
||||
QueryResult* result = LoginDatabase.PQuery("SELECT id, username, last_ip, gmlevel, expansion FROM account WHERE active_realm_id = %u", realmID);
|
||||
QueryResult* result = LoginDatabase.PQuery("SELECT `id`, `username`, `last_ip`, `gmlevel`, `expansion` FROM `account` WHERE `active_realm_id` = %u", realmID);
|
||||
|
||||
return ShowAccountListHelper(result, &limit);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue