Fixed doctrine middlewares

We now look directly onto the driver arguments instead of retrieving a database platform, for which we would need the database version.

As we modify driver specific options there, this might be the better choice anyway
This commit is contained in:
Jan Böhmer
2024-06-09 23:28:46 +02:00
parent 43ca543651
commit 777bfed813
3 changed files with 3 additions and 3 deletions

View File

@@ -35,7 +35,7 @@ class SetSQLModeMiddlewareDriver extends AbstractDriverMiddleware
public function connect(array $params): Connection
{
//Only set this on MySQL connections, as other databases don't support this parameter
if($this->getDatabasePlatform() instanceof AbstractMySQLPlatform) {
if($params['driver'] === 'pdo_mysql') {
//1002 is \PDO::MYSQL_ATTR_INIT_COMMAND constant value
$params['driverOptions'][\PDO::MYSQL_ATTR_INIT_COMMAND] = 'SET SESSION sql_mode=(SELECT REPLACE(@@sql_mode, \'ONLY_FULL_GROUP_BY\', \'\'))';
}