diff --git a/src/Platforms/MariaDBPlatform.php b/src/Platforms/MariaDBPlatform.php index c83bc104e4a..d32ba12e07e 100644 --- a/src/Platforms/MariaDBPlatform.php +++ b/src/Platforms/MariaDBPlatform.php @@ -169,6 +169,7 @@ protected function createReservedKeywordsList(): KeywordList * {@inheritDoc} * * @link https://mariadb.com/kb/en/unicode/ + * @link https://mariadb.com/kb/en/old-mode/ */ public function informationSchemaUsesUtf8mb3(Connection $connection): bool { @@ -176,6 +177,8 @@ public function informationSchemaUsesUtf8mb3(Connection $connection): bool return false; } - return ! $connection->fetchOne('SELECT @old_mode'); + $old_mode = (string) $connection->fetchOne('SELECT @old_mode'); + + return ! str_contains($old_mode, 'UTF8_IS_UTF8MB3'); } } diff --git a/tests/Platforms/MySQL/ComparatorTest.php b/tests/Platforms/MySQL/ComparatorTest.php index 64e73f6ccf3..e8ecad8101e 100644 --- a/tests/Platforms/MySQL/ComparatorTest.php +++ b/tests/Platforms/MySQL/ComparatorTest.php @@ -96,7 +96,7 @@ public function testUtf8AndUtf8mb3Mismatches(bool $useUtf8mb3, string $defaultCh self::assertNotEmpty($utf8Comparator->compareTables($table6, $table5)->getModifiedColumns()); } - /** @return array{bool,string}[] */ + /** @return iterable */ public static function utf8AndUtf8mb3MismatchesProvider(): iterable { yield [false, 'utf8'];