Merge branch 'azerothcore:master' into Playerbot

This commit is contained in:
bash
2025-10-01 12:16:44 +02:00
committed by GitHub
5 changed files with 22 additions and 4 deletions

View File

@@ -343,6 +343,14 @@ Updates.AllowRehash = 1
Updates.CleanDeadRefMaxCount = 3
#
# Updates.ExceptionShutdownDelay
# Description: Time (in milliseconds) to wait before shutting down after a fatal exception (e.g. failed SQL update).
# Default: 10000 - 10 seconds
# 0 - Disabled (immediate shutdown)
Updates.ExceptionShutdownDelay = 10000
#
###################################################################################################

View File

@@ -576,7 +576,12 @@ void DBUpdater<T>::ApplyFile(DatabaseWorkerPool<T>& pool, std::string const& hos
path.generic_string(), pool.GetConnectionInfo()->database);
if (!sConfigMgr->isDryRun())
{
if (uint32 delay = sConfigMgr->GetOption<uint32>("Updates.ExceptionShutdownDelay", 10000))
std::this_thread::sleep_for(Milliseconds(delay));
throw UpdateException("update failed");
}
}
}

View File

@@ -137,10 +137,7 @@ public:
// Make sure we don't pass double quotes into the SQL query. Otherwise it causes a MySQL error
std::string str = name.data(); // Making subtractions to the last character does not with in string_view
if (str.front() == '"')
str = str.substr(1);
if (str.back() == '"')
str = str.substr(0, str.size() - 1);
WorldDatabase.EscapeString(str);
QueryResult result = WorldDatabase.Query("SELECT entry FROM creature_template WHERE name = \"{}\" LIMIT 1", str);
if (!result)