From 2f1e19efdec2a9fc8af4cd66dc1091c5ba23d282 Mon Sep 17 00:00:00 2001 From: "Alexander M. Turek" Date: Fri, 4 Aug 2023 16:29:00 +0200 Subject: [PATCH] Sync MariaDB support strategy with upstream (#6110) --- .github/workflows/continuous-integration.yml | 28 ++++++++++--------- psalm.xml.dist | 1 + src/Driver/AbstractMySQLDriver.php | 19 +++++++++---- src/Platforms/MariaDb1027Platform.php | 2 +- src/Platforms/MariaDb1043Platform.php | 3 ++ .../Driver/VersionAwarePlatformDriverTest.php | 6 ++++ 6 files changed, 39 insertions(+), 20 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 5c9ae3a0554..ec901201cfb 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -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: @@ -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" diff --git a/psalm.xml.dist b/psalm.xml.dist index 126e4a28837..3662f69b06a 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -62,6 +62,7 @@ + diff --git a/src/Driver/AbstractMySQLDriver.php b/src/Driver/AbstractMySQLDriver.php index eeea3791948..f4cd949b562 100644 --- a/src/Driver/AbstractMySQLDriver.php +++ b/src/Driver/AbstractMySQLDriver.php @@ -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(); } @@ -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(); } diff --git a/src/Platforms/MariaDb1027Platform.php b/src/Platforms/MariaDb1027Platform.php index 93c7d348854..68f38133210 100644 --- a/src/Platforms/MariaDb1027Platform.php +++ b/src/Platforms/MariaDb1027Platform.php @@ -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 { diff --git a/src/Platforms/MariaDb1043Platform.php b/src/Platforms/MariaDb1043Platform.php index d8f1b0a561e..926c6b9529d 100644 --- a/src/Platforms/MariaDb1043Platform.php +++ b/src/Platforms/MariaDb1043Platform.php @@ -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 { diff --git a/tests/Driver/VersionAwarePlatformDriverTest.php b/tests/Driver/VersionAwarePlatformDriverTest.php index c17a9802115..85fe30c3c99 100644 --- a/tests/Driver/VersionAwarePlatformDriverTest.php +++ b/tests/Driver/VersionAwarePlatformDriverTest.php @@ -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, + ], ]; }