Skip to content

Commit

Permalink
Sync MariaDB support strategy with upstream (doctrine#6110)
Browse files Browse the repository at this point in the history
  • Loading branch information
derrabus committed Aug 4, 2023
1 parent be8451a commit 2f1e19e
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 20 deletions.
28 changes: 15 additions & 13 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -293,33 +293,35 @@ jobs:
php-version:
- "7.4"
mariadb-version:
- "10.0"
- "10.2"
- "10.5"
- "10.7"
- "10.9"
- "10.11"
- "10.0" # Oldest version supported by DBAL
- "10.4" # LTS (Jun 2024)
- "10.5" # LTS (Jun 2025)
- "10.6" # LTS (Jul 2026)
- "10.9" # STS (Aug 2023)
- "10.10" # STS (Nov 2023)
- "10.11" # LTS (Feb 2028)
- "11.0" # STS (Jun 2024)
extension:
- "mysqli"
- "pdo_mysql"
include:
- php-version: "8.2"
mariadb-version: "10.7"
mariadb-version: "10.6"
extension: "mysqli"
- php-version: "8.2"
mariadb-version: "10.7"
mariadb-version: "10.6"
extension: "pdo_mysql"
- php-version: "8.2"
mariadb-version: "10.11"
mariadb-version: "11.0"
extension: "mysqli"
- php-version: "8.2"
mariadb-version: "10.11"
mariadb-version: "11.0"
extension: "pdo_mysql"
- php-version: "8.3"
mariadb-version: "10.11"
mariadb-version: "11.0"
extension: "mysqli"
- php-version: "8.3"
mariadb-version: "10.11"
mariadb-version: "11.0"
extension: "pdo_mysql"

services:
Expand All @@ -330,7 +332,7 @@ jobs:
MYSQL_DATABASE: "doctrine_tests"

options: >-
--health-cmd "mysqladmin ping --silent"
--health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent"
ports:
- "3306:3306"
Expand Down
1 change: 1 addition & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords"/>
<referencedClass name="Doctrine\DBAL\Platforms\MariaDb1027Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\MariaDb1043Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\MySQL57Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL100Platform"/>
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL94Platform"/>
Expand Down
19 changes: 13 additions & 6 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ public function createDatabasePlatformForVersion($version)
return new MariaDb1043Platform();
}

Deprecation::trigger(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6110',
'Support for MariaDB < 10.4 is deprecated and will be removed in DBAL 4.'
. ' Consider upgrading to a more recent version of MariaDB.',
);

if (version_compare($mariaDbVersion, '10.2.7', '>=')) {
return new MariaDb1027Platform();
}
Expand Down Expand Up @@ -77,14 +84,14 @@ public function createDatabasePlatformForVersion($version)

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.'
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 $this->getDatabasePlatform();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Platforms/MariaDb1027Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
* Note: Should not be used with versions prior to 10.2.7.
*
* @deprecated This class will be merged with {@see MariaDBPlatform} in 4.0 because support for MariaDB
* releases prior to 10.2.7 will be dropped.
* releases prior to 10.4.3 will be dropped.
*/
class MariaDb1027Platform extends MariaDBPlatform
{
Expand Down
3 changes: 3 additions & 0 deletions src/Platforms/MariaDb1043Platform.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@
*
* Extend deprecated MariaDb1027Platform to ensure correct functions used in MySQLSchemaManager which
* tests for MariaDb1027Platform not MariaDBPlatform.
*
* @deprecated This class will be merged with {@see MariaDBPlatform} in 4.0 because support for MariaDB
* releases prior to 10.4.3 will be dropped.
*/
class MariaDb1043Platform extends MariaDb1027Platform
{
Expand Down
6 changes: 6 additions & 0 deletions tests/Driver/VersionAwarePlatformDriverTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,12 @@ public static function mySQLVersionProvider(): array
'https://github.com/doctrine/dbal/pull/5779',
false,
],
[
'11.0.2-MariaDB-1:11.0.2+maria~ubu2204',
MariaDB1052Platform::class,
'https://github.com/doctrine/dbal/pull/5779',
false,
],
];
}

Expand Down

0 comments on commit 2f1e19e

Please sign in to comment.