mirror of
https://github.com/anope/anope.git
synced 2026-06-29 00:46:39 +02:00
Force the MySQL module to use UTC for connections.
This prevents conversion issues when the MySQL server is in a different timezone to the services server.
This commit is contained in:
@@ -631,6 +631,10 @@ void MySQLService::Connect()
|
||||
if (!connect)
|
||||
throw SQL::Exception("Unable to connect to MySQL service " + this->name + ": " + mysql_error(this->sql));
|
||||
|
||||
// We force UTC so that FromUnixtime works as expected.
|
||||
SQL::Query tzquery("SET time_zone = '+00:00'");
|
||||
RunQuery(tzquery);
|
||||
|
||||
if (this->socket.empty())
|
||||
Log(LOG_DEBUG) << "Successfully connected to MySQL service " << this->name << " at " << this->server << ":" << this->port;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user