Skip to content

Deprecate MariaDB 10.4 and MySQL 5.7 support #6343

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@ awareness about deprecated code.

# Upgrade to 4.0

## Deprecated support for MariaDB 10.4 and MySQL 5.7

* Upgrade to MariaDB 10.5 or later.
* Upgrade to MySQL 8.0 or later.

# Upgrade to 4.0

## BC BREAK: removed `AbstractMySQLPlatform` methods.

1. `getColumnTypeSQLSnippets()`,
Expand Down
11 changes: 11 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,17 @@
<file name="src/Driver/OCI8/ConvertPositionalToNamedPlaceholders.php"/>
</errorLevel>
</ConflictingReferenceConstraint>
<DeprecatedClass>
<errorLevel type="suppress">
<!--
See https://github.com/doctrine/dbal/pull/6343
TODO: remove in 5.0.0
-->
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\MySQL80Keywords" />
<referencedClass name="Doctrine\DBAL\Platforms\MariaDB1052Platform" />
<referencedClass name="Doctrine\DBAL\Platforms\MySQL80Platform" />
</errorLevel>
</DeprecatedClass>
<DeprecatedMethod>
<errorLevel type="suppress">
<!--
Expand Down
13 changes: 13 additions & 0 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
use Doctrine\DBAL\Platforms\MySQL80Platform;
use Doctrine\DBAL\Platforms\MySQLPlatform;
use Doctrine\DBAL\ServerVersionProvider;
use Doctrine\Deprecations\Deprecation;

use function preg_match;
use function stripos;
Expand Down Expand Up @@ -43,13 +44,25 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Abs
return new MariaDB1052Platform();
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6343',
'Support for MariaDB < 10.5.2 is deprecated and will be removed in DBAL 5',
);

return new MariaDBPlatform();
}

if (version_compare($version, '8.0.0', '>=')) {
return new MySQL80Platform();
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6343',
'Support for MySQL < 8 is deprecated and will be removed in DBAL 5',
);

return new MySQLPlatform();
}

Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/Keywords/MySQL80Keywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@

/**
* MySQL 8.0 reserved keywords list.
*
* @deprecated This class will be removed once support for MySQL 5.7 is dropped.
*/
class MySQL80Keywords extends MySQLKeywords
{
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/MariaDB1052Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
/**
* Provides the behavior, features and SQL dialect of the MariaDB 10.5 (10.5.2 GA) database platform.
*
* Note: Should not be used with versions prior to 10.5.2.
* @deprecated This class will be removed once support for MariaDB 10.4 is dropped.
*/
class MariaDB1052Platform extends MariaDBPlatform
{
Expand Down
2 changes: 2 additions & 0 deletions src/Platforms/MySQL80Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

/**
* Provides the behavior, features and SQL dialect of the MySQL 8.0 (8.0 GA) database platform.
*
* @deprecated This class will be removed once support for MySQL 5.7 is dropped.
*/
class MySQL80Platform extends MySQLPlatform
{
Expand Down
Loading