Skip to content

Commit

Permalink
Drop support for MySQL 5.6 and older
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Dec 4, 2021
1 parent 1c3e330 commit 9c149a3
Show file tree
Hide file tree
Showing 16 changed files with 85 additions and 605 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -205,8 +205,7 @@ jobs:
php-version:
- "8.0"
mariadb-version:
- "10.0"
- "10.2"
- "10.3"
- "10.5"
extension:
- "mysqli"
Expand Down
8 changes: 8 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ awareness about deprecated code.

# Upgrade to 4.0

## BC BREAK: Removed support for MySQL 5.6 and older

MySQL 5.6 and older are not supported anymore. The following classes have been merged into their respective
parent classes:

* `Doctrine\DBAL\Platforms\MySQL57Platform`
* `Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords`

## BC BREAK: Removed active support for Postgres 9

Postgres 9 is not actively supported anymore. The following classes have been merged into their respective parent class:
Expand Down
3 changes: 1 addition & 2 deletions docs/en/reference/platforms.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,7 @@ can be found as follows:
MySQL
^^^^^

- ``MySQLPlatform`` for version 5.0 and above.
- ``MySQL57Platform`` for version 5.7 (5.7.9 GA) and above.
- ``MySQLPlatform`` for version 5.7 (5.7.9 GA) and above.
- ``MySQL80Platform`` for version 8.0 (8.0 GA) and above.

MariaDB
Expand Down
5 changes: 0 additions & 5 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,6 @@
is no longer supported.
-->
<file name="src/Tools/Console/ConsoleRunner.php"/>
<!--
TODO: remove in 4.0.0
-->
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MySQL57Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\MySQL57Platform"/>
</errorLevel>
</DeprecatedClass>
<DeprecatedMethod>
Expand Down
13 changes: 0 additions & 13 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,10 @@
use Doctrine\DBAL\Platforms\AbstractPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\MariaDb1027Platform;
use Doctrine\DBAL\Platforms\MySQL57Platform;
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\Schema\MySQLSchemaManager;
use Doctrine\DBAL\ServerVersionProvider;
use Doctrine\Deprecations\Deprecation;

use function assert;
use function preg_match;
Expand Down Expand Up @@ -46,19 +44,8 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): MyS
if (version_compare($oracleMysqlVersion, '8', '>=')) {
return new MySQL80Platform();
}

if (version_compare($oracleMysqlVersion, '5.7.9', '>=')) {
return new MySQL57Platform();
}
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/5060',
'MySQL 5.6 support is deprecated and will be removed in DBAL 4.'
. ' Consider upgrading to MySQL 5.7 or later.'
);

return new MySQLPlatform();
}

Expand Down
264 changes: 0 additions & 264 deletions src/Platforms/Keywords/MySQL57Keywords.php

This file was deleted.

8 changes: 2 additions & 6 deletions src/Platforms/Keywords/MySQL80Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* MySQL 8.0 reserved keywords list.
*/
class MySQL80Keywords extends MySQL57Keywords
class MySQL80Keywords extends MySQLKeywords
{
public function getName(): string
{
Expand All @@ -23,9 +23,7 @@ public function getName(): string
*/
protected function getKeywords(): array
{
$keywords = parent::getKeywords();

$keywords = array_merge($keywords, [
return array_merge(parent::getKeywords(), [
'ADMIN',
'ARRAY',
'CUBE',
Expand Down Expand Up @@ -58,7 +56,5 @@ protected function getKeywords(): array
'SYSTEM',
'WINDOW',
]);

return $keywords;
}
}

0 comments on commit 9c149a3

Please sign in to comment.