diff --git a/src/Database/Driver/PDOMySqlConcrete5/Driver.php b/src/Database/Driver/PDOMySqlConcrete5/Driver.php index 05f4d03093..d0534fe693 100644 --- a/src/Database/Driver/PDOMySqlConcrete5/Driver.php +++ b/src/Database/Driver/PDOMySqlConcrete5/Driver.php @@ -2,6 +2,7 @@ namespace Concrete\Core\Database\Driver\PDOMySqlConcrete5; use Concrete\Core\Database\Connection\PDOConnection; +use Concrete\Core\Database\Platforms\MySQL80Platform; /** * PDO MySql driver. @@ -22,6 +23,24 @@ public function connect(array $params, $username = null, $password = null, array return $conn; } + /** + * {@inheritdoc} + * + * @see \Doctrine\DBAL\Driver\AbstractMySQLDriver::createDatabasePlatformForVersion() + */ + public function createDatabasePlatformForVersion($version) + { + if (false === stripos($version, 'mariadb')) { + if (preg_match('/^(\d+)/', $version, $match)) { + if ((int) $match[1] >= 8) { + return new MySQL80Platform(); + } + } + } + + return parent::createDatabasePlatformForVersion($version); + } + /** * Constructs the MySql PDO DSN. * diff --git a/src/Database/Platforms/Keywords/MySQL80Keywords.php b/src/Database/Platforms/Keywords/MySQL80Keywords.php new file mode 100644 index 0000000000..df9e27f838 --- /dev/null +++ b/src/Database/Platforms/Keywords/MySQL80Keywords.php @@ -0,0 +1,64 @@ +