Skip to content

Commit 2f1e19e

Browse files
authored
Sync MariaDB support strategy with upstream (doctrine#6110)
1 parent be8451a commit 2f1e19e

File tree

6 files changed

+39
-20
lines changed

6 files changed

+39
-20
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 15 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -293,33 +293,35 @@ jobs:
293293
php-version:
294294
- "7.4"
295295
mariadb-version:
296-
- "10.0"
297-
- "10.2"
298-
- "10.5"
299-
- "10.7"
300-
- "10.9"
301-
- "10.11"
296+
- "10.0" # Oldest version supported by DBAL
297+
- "10.4" # LTS (Jun 2024)
298+
- "10.5" # LTS (Jun 2025)
299+
- "10.6" # LTS (Jul 2026)
300+
- "10.9" # STS (Aug 2023)
301+
- "10.10" # STS (Nov 2023)
302+
- "10.11" # LTS (Feb 2028)
303+
- "11.0" # STS (Jun 2024)
302304
extension:
303305
- "mysqli"
304306
- "pdo_mysql"
305307
include:
306308
- php-version: "8.2"
307-
mariadb-version: "10.7"
309+
mariadb-version: "10.6"
308310
extension: "mysqli"
309311
- php-version: "8.2"
310-
mariadb-version: "10.7"
312+
mariadb-version: "10.6"
311313
extension: "pdo_mysql"
312314
- php-version: "8.2"
313-
mariadb-version: "10.11"
315+
mariadb-version: "11.0"
314316
extension: "mysqli"
315317
- php-version: "8.2"
316-
mariadb-version: "10.11"
318+
mariadb-version: "11.0"
317319
extension: "pdo_mysql"
318320
- php-version: "8.3"
319-
mariadb-version: "10.11"
321+
mariadb-version: "11.0"
320322
extension: "mysqli"
321323
- php-version: "8.3"
322-
mariadb-version: "10.11"
324+
mariadb-version: "11.0"
323325
extension: "pdo_mysql"
324326

325327
services:
@@ -330,7 +332,7 @@ jobs:
330332
MYSQL_DATABASE: "doctrine_tests"
331333

332334
options: >-
333-
--health-cmd "mysqladmin ping --silent"
335+
--health-cmd "mariadb-admin ping --silent || mysqladmin ping --silent"
334336
335337
ports:
336338
- "3306:3306"

psalm.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\PostgreSQL94Keywords"/>
6363
<referencedClass name="Doctrine\DBAL\Platforms\Keywords\SQLServer2012Keywords"/>
6464
<referencedClass name="Doctrine\DBAL\Platforms\MariaDb1027Platform"/>
65+
<referencedClass name="Doctrine\DBAL\Platforms\MariaDb1043Platform"/>
6566
<referencedClass name="Doctrine\DBAL\Platforms\MySQL57Platform"/>
6667
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL100Platform"/>
6768
<referencedClass name="Doctrine\DBAL\Platforms\PostgreSQL94Platform"/>

src/Driver/AbstractMySQLDriver.php

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ public function createDatabasePlatformForVersion($version)
4747
return new MariaDb1043Platform();
4848
}
4949

50+
Deprecation::trigger(
51+
'doctrine/dbal',
52+
'https://github.com/doctrine/dbal/pull/6110',
53+
'Support for MariaDB < 10.4 is deprecated and will be removed in DBAL 4.'
54+
. ' Consider upgrading to a more recent version of MariaDB.',
55+
);
56+
5057
if (version_compare($mariaDbVersion, '10.2.7', '>=')) {
5158
return new MariaDb1027Platform();
5259
}
@@ -77,14 +84,14 @@ public function createDatabasePlatformForVersion($version)
7784

7885
return new MySQL57Platform();
7986
}
80-
}
8187

82-
Deprecation::trigger(
83-
'doctrine/dbal',
84-
'https://github.com/doctrine/dbal/pull/5060',
85-
'MySQL 5.6 support is deprecated and will be removed in DBAL 4.'
88+
Deprecation::trigger(
89+
'doctrine/dbal',
90+
'https://github.com/doctrine/dbal/pull/5060',
91+
'MySQL 5.6 support is deprecated and will be removed in DBAL 4.'
8692
. ' Consider upgrading to MySQL 5.7 or later.',
87-
);
93+
);
94+
}
8895

8996
return $this->getDatabasePlatform();
9097
}

src/Platforms/MariaDb1027Platform.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
* Note: Should not be used with versions prior to 10.2.7.
99
*
1010
* @deprecated This class will be merged with {@see MariaDBPlatform} in 4.0 because support for MariaDB
11-
* releases prior to 10.2.7 will be dropped.
11+
* releases prior to 10.4.3 will be dropped.
1212
*/
1313
class MariaDb1027Platform extends MariaDBPlatform
1414
{

src/Platforms/MariaDb1043Platform.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
*
1212
* Extend deprecated MariaDb1027Platform to ensure correct functions used in MySQLSchemaManager which
1313
* tests for MariaDb1027Platform not MariaDBPlatform.
14+
*
15+
* @deprecated This class will be merged with {@see MariaDBPlatform} in 4.0 because support for MariaDB
16+
* releases prior to 10.4.3 will be dropped.
1417
*/
1518
class MariaDb1043Platform extends MariaDb1027Platform
1619
{

tests/Driver/VersionAwarePlatformDriverTest.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,12 @@ public static function mySQLVersionProvider(): array
8080
'https://github.com/doctrine/dbal/pull/5779',
8181
false,
8282
],
83+
[
84+
'11.0.2-MariaDB-1:11.0.2+maria~ubu2204',
85+
MariaDB1052Platform::class,
86+
'https://github.com/doctrine/dbal/pull/5779',
87+
false,
88+
],
8389
];
8490
}
8591

0 commit comments

Comments
 (0)