Skip to content

Commit

Permalink
Remove support for MariaDB 10.4 and MySQL 5.7 (#6346)
Browse files Browse the repository at this point in the history
|      Q       |   A
|------------- | -----------
| Type         | improvement
| Fixed issues | Follows #6343

#### Summary

This PR removes support for old MariaDB and MySQL releases.
  • Loading branch information
derrabus authored Mar 21, 2024
1 parent 140ecec commit 303e60d
Show file tree
Hide file tree
Showing 17 changed files with 99 additions and 336 deletions.
4 changes: 1 addition & 3 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,8 +281,7 @@ jobs:
- "8.1"
mariadb-version:
# keep in sync with https://mariadb.org/about/#maintenance-policy
- "10.4" # Oldest version supported by DBAL, LTS (Jun 2024)
- "10.5" # LTS (Jun 2025)
- "10.5" # Oldest version supported by DBAL, LTS (Jun 2025)
- "10.6" # LTS (Jul 2026)
- "10.11" # LTS (Feb 2028)
- "11.0" # STS (Jun 2024)
Expand Down Expand Up @@ -351,7 +350,6 @@ jobs:
php-version:
- "8.1"
mysql-version:
- "5.7"
- "8.0"
- "8.3"
extension:
Expand Down
7 changes: 7 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,13 @@ awareness about deprecated code.
- Use of our low-overhead runtime deprecation API, details:
https://github.com/doctrine/deprecations/

# Upgrade to 5.0

## BC BREAK: Removed 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.1

## Deprecated support for MariaDB 10.4 and MySQL 5.7
Expand Down
11 changes: 0 additions & 11 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -42,17 +42,6 @@
<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
23 changes: 0 additions & 23 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,10 @@
use Doctrine\DBAL\Driver\API\MySQL\ExceptionConverter;
use Doctrine\DBAL\Platforms\AbstractMySQLPlatform;
use Doctrine\DBAL\Platforms\Exception\InvalidPlatformVersion;
use Doctrine\DBAL\Platforms\MariaDB1052Platform;
use Doctrine\DBAL\Platforms\MariaDB1060Platform;
use Doctrine\DBAL\Platforms\MariaDBPlatform;
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 All @@ -40,29 +37,9 @@ public function getDatabasePlatform(ServerVersionProvider $versionProvider): Abs
return new MariaDB1060Platform();
}

if (version_compare($mariaDbVersion, '10.5.2', '>=')) {
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
7 changes: 0 additions & 7 deletions src/Platforms/AbstractMySQLPlatform.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@
use Doctrine\DBAL\Schema\Index;
use Doctrine\DBAL\Schema\MySQLSchemaManager;
use Doctrine\DBAL\Schema\TableDiff;
use Doctrine\DBAL\SQL\Builder\DefaultSelectSQLBuilder;
use Doctrine\DBAL\SQL\Builder\SelectSQLBuilder;
use Doctrine\DBAL\TransactionIsolationLevel;
use Doctrine\DBAL\Types\Types;

Expand Down Expand Up @@ -282,11 +280,6 @@ protected function _getCreateTableSQL(string $name, array $columns, array $optio
return $sql;
}

public function createSelectSQLBuilder(): SelectSQLBuilder
{
return new DefaultSelectSQLBuilder($this, 'FOR UPDATE', null);
}

/**
* Build SQL for table options
*
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/Keywords/MariaDBKeywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\DBAL\Platforms\Keywords;

class MariaDBKeywords extends MySQLKeywords
class MariaDBKeywords extends KeywordList
{
/**
* {@inheritDoc}
Expand Down
61 changes: 0 additions & 61 deletions src/Platforms/Keywords/MySQL80Keywords.php

This file was deleted.

31 changes: 31 additions & 0 deletions src/Platforms/Keywords/MySQLKeywords.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ protected function getKeywords(): array
return [
'ACCESSIBLE',
'ADD',
'ADMIN',
'ALL',
'ALTER',
'ANALYZE',
'AND',
'ARRAY',
'AS',
'ASC',
'ASENSITIVE',
Expand All @@ -48,6 +50,8 @@ protected function getKeywords(): array
'CONVERT',
'CREATE',
'CROSS',
'CUBE',
'CUME_DIST',
'CURRENT_DATE',
'CURRENT_TIME',
'CURRENT_TIMESTAMP',
Expand All @@ -65,6 +69,7 @@ protected function getKeywords(): array
'DEFAULT',
'DELAYED',
'DELETE',
'DENSE_RANK',
'DESC',
'DESCRIBE',
'DETERMINISTIC',
Expand All @@ -77,13 +82,16 @@ protected function getKeywords(): array
'EACH',
'ELSE',
'ELSEIF',
'EMPTY',
'ENCLOSED',
'ESCAPED',
'EXISTS',
'EXCEPT',
'EXIT',
'EXPLAIN',
'FALSE',
'FETCH',
'FIRST_VALUE',
'FLOAT',
'FLOAT4',
'FLOAT8',
Expand All @@ -92,10 +100,13 @@ protected function getKeywords(): array
'FOREIGN',
'FROM',
'FULLTEXT',
'FUNCTION',
'GENERATED',
'GET',
'GRANT',
'GROUP',
'GROUPING',
'GROUPS',
'HAVING',
'HIGH_PRIORITY',
'HOUR_MICROSECOND',
Expand Down Expand Up @@ -123,10 +134,15 @@ protected function getKeywords(): array
'IO_BEFORE_GTIDS',
'IS',
'ITERATE',
'JSON_TABLE',
'JOIN',
'KEY',
'KEYS',
'KILL',
'LAG',
'LAST_VALUE',
'LATERAL',
'LEAD',
'LEADING',
'LEAVE',
'LEFT',
Expand All @@ -150,6 +166,7 @@ protected function getKeywords(): array
'MEDIUMBLOB',
'MEDIUMINT',
'MEDIUMTEXT',
'MEMBER',
'MIDDLEINT',
'MINUTE_MICROSECOND',
'MINUTE_SECOND',
Expand All @@ -158,8 +175,11 @@ protected function getKeywords(): array
'NATURAL',
'NO_WRITE_TO_BINLOG',
'NOT',
'NTH_VALUE',
'NTILE',
'NULL',
'NUMERIC',
'OF',
'ON',
'OPTIMIZE',
'OPTIMIZER_COSTS',
Expand All @@ -170,16 +190,22 @@ protected function getKeywords(): array
'OUT',
'OUTER',
'OUTFILE',
'OVER',
'PARTITION',
'PERCENT_RANK',
'PERSIST',
'PERSIST_ONLY',
'PRECISION',
'PRIMARY',
'PROCEDURE',
'PURGE',
'RANK',
'RANGE',
'READ',
'READ_WRITE',
'READS',
'REAL',
'RECURSIVE',
'REFERENCES',
'REGEXP',
'RELEASE',
Expand All @@ -193,6 +219,9 @@ protected function getKeywords(): array
'REVOKE',
'RIGHT',
'RLIKE',
'ROW',
'ROWS',
'ROW_NUMBER',
'SCHEMA',
'SCHEMAS',
'SECOND_MICROSECOND',
Expand All @@ -216,6 +245,7 @@ protected function getKeywords(): array
'STARTING',
'STORED',
'STRAIGHT_JOIN',
'SYSTEM',
'TABLE',
'TERMINATED',
'THEN',
Expand Down Expand Up @@ -247,6 +277,7 @@ protected function getKeywords(): array
'WHEN',
'WHERE',
'WHILE',
'WINDOW',
'WITH',
'WRITE',
'XOR',
Expand Down
40 changes: 0 additions & 40 deletions src/Platforms/MariaDB1052Platform.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Platforms/MariaDB1060Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
/**
* Provides the behavior, features and SQL dialect of the MariaDB 10.6 (10.6.0 GA) database platform.
*/
class MariaDB1060Platform extends MariaDB1052Platform
class MariaDB1060Platform extends MariaDBPlatform
{
public function createSelectSQLBuilder(): SelectSQLBuilder
{
Expand Down
Loading

0 comments on commit 303e60d

Please sign in to comment.