Skip to content

Commit

Permalink
AbstractMySQLDriver. Use MariaDb1043Platform where applicable.
Browse files Browse the repository at this point in the history
Select MariaDb1043Platform where MariaDb database is at version 10.4.3
or later.
  • Loading branch information
cgknx committed Feb 18, 2023
1 parent a6b3f20 commit fc88321
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Driver/AbstractMySQLDriver.php
Expand Up @@ -9,6 +9,7 @@
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Platforms\MariaDb1043Platform;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
Expand All @@ -34,6 +35,10 @@ abstract class AbstractMySQLDriver implements VersionAwarePlatformDriver
public function createDatabasePlatformForVersion($version)
{
$mariadb = stripos($version, 'mariadb') !== false;
if ($mariadb && version_compare($this->getMariaDbMysqlVersionNumber($version), '10.4.3', '>=')) {
return new MariaDb1043Platform();
}

if ($mariadb && version_compare($this->getMariaDbMysqlVersionNumber($version), '10.2.7', '>=')) {
return new MariaDb1027Platform();
}
Expand Down

0 comments on commit fc88321

Please sign in to comment.