From f921da9c1e7bc76170c424339efc6f4ffe7f46a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Thu, 19 Oct 2023 16:53:41 +0200 Subject: [PATCH 1/9] Fix MariaDB list columns performance --- src/Platforms/AbstractMySQLPlatform.php | 2 +- src/Platforms/MariaDb1043Platform.php | 31 ++++++++++--------- src/Schema/MySQLSchemaManager.php | 2 +- .../Schema/MySQLSchemaManagerTest.php | 6 ++++ 4 files changed, 25 insertions(+), 16 deletions(-) diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index d1e3e5aff52..fb0d686beaa 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -404,7 +404,7 @@ public function getListTableColumnsSQL($table, $database = null) * * @return array{string, string} */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array + public function getColumnTypeSQLSnippets(string $tableAlias = 'c', ?string $databaseName = null): array { return [$tableAlias . '.COLUMN_TYPE', '']; } diff --git a/src/Platforms/MariaDb1043Platform.php b/src/Platforms/MariaDb1043Platform.php index 926c6b9529d..785c654be96 100644 --- a/src/Platforms/MariaDb1043Platform.php +++ b/src/Platforms/MariaDb1043Platform.php @@ -40,7 +40,7 @@ public function getJsonTypeDeclarationSQL(array $column): string */ public function getListTableColumnsSQL($table, $database = null): string { - [$columnTypeSQL, $joinCheckConstraintSQL] = $this->getColumnTypeSQLSnippets(); + [$columnTypeSQL, $joinCheckConstraintSQL] = $this->getColumnTypeSQLSnippets('c', $database); return sprintf( <<getJsonTypeDeclarationSQL([]) !== 'JSON') { - return parent::getColumnTypeSQLSnippets($tableAlias); + return parent::getColumnTypeSQLSnippets($tableAlias, $databaseName); } + $databaseName = $this->getDatabaseNameSQL($databaseName); + $columnTypeSQL = <<_platform->getColumnTypeSQLSnippets(); + [$columnTypeSQL, $joinCheckConstraintSQL] = $this->_platform->getColumnTypeSQLSnippets('c', $databaseName); $sql = 'SELECT'; diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php index 3e90d6aabed..519360928bd 100644 --- a/tests/Functional/Schema/MySQLSchemaManagerTest.php +++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php @@ -6,6 +6,7 @@ use Doctrine\DBAL\Platforms\AbstractMySQLPlatform; use Doctrine\DBAL\Platforms\AbstractPlatform; use Doctrine\DBAL\Platforms\MariaDb1027Platform; +use Doctrine\DBAL\Platforms\MariaDb1043Platform; use Doctrine\DBAL\Schema\Schema; use Doctrine\DBAL\Schema\Table; use Doctrine\DBAL\Tests\Functional\Schema\MySQL\PointType; @@ -401,6 +402,11 @@ public function testJsonColumnType(): void $table->addColumn('col_json', Types::JSON); $this->dropAndCreateTable($table); + // Remove the comment from the column to ensure the type is detected correctly from the check constraints. + if ($this->connection->getDatabasePlatform() instanceof MariaDb1043Platform) { + $this->connection->executeStatement('ALTER TABLE test_mysql_json CHANGE COLUMN col_json col_json JSON'); + } + $columns = $this->schemaManager->listTableColumns('test_mysql_json'); self::assertSame(Types::JSON, $columns['col_json']->getType()->getName()); From d0ac1daf7c48b424a92d88e5f4a41ea22901e210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Fri, 3 Nov 2023 11:45:12 +0100 Subject: [PATCH 2/9] Fix backwards compatibility --- src/Platforms/AbstractMySQLPlatform.php | 4 +++- src/Platforms/MariaDb1043Platform.php | 11 +++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index fb0d686beaa..6c1dbbd82a8 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -402,9 +402,11 @@ public function getListTableColumnsSQL($table, $database = null) * * Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet] * + * @param string|null $databaseName + * * @return array{string, string} */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c', ?string $databaseName = null): array + public function getColumnTypeSQLSnippets(string $tableAlias = 'c' /* , ?string $databaseName = null*/): array { return [$tableAlias . '.COLUMN_TYPE', '']; } diff --git a/src/Platforms/MariaDb1043Platform.php b/src/Platforms/MariaDb1043Platform.php index 785c654be96..ae5ce164220 100644 --- a/src/Platforms/MariaDb1043Platform.php +++ b/src/Platforms/MariaDb1043Platform.php @@ -4,6 +4,8 @@ use Doctrine\DBAL\Types\JsonType; +use function func_get_arg; +use function func_num_args; use function sprintf; /** @@ -72,18 +74,23 @@ public function getListTableColumnsSQL($table, $database = null): string * is valid json. This function generates the SQL snippets which reverse this aliasing i.e. report a column * as JSON where it was originally specified as such instead of LONGTEXT. * - * The CHECK constraints are stored in information_schema.CHECK_CONSTRAINTS so JOIN that table. + * The CHECK constraints are stored in information_schema.CHECK_CONSTRAINTS so query that table. + * + * @param string|null $databaseName * * @return array{string, string} */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c', ?string $databaseName = null): array + public function getColumnTypeSQLSnippets(string $tableAlias = 'c' /* , ?string $databaseName = null*/): array { + $databaseName = func_num_args() > 1 ? func_get_arg(1) : null; + if ($this->getJsonTypeDeclarationSQL([]) !== 'JSON') { return parent::getColumnTypeSQLSnippets($tableAlias, $databaseName); } $databaseName = $this->getDatabaseNameSQL($databaseName); + // The check for `CONSTRAINT_SCHEMA = $databaseName` is mandatory here to prevent performance issues $columnTypeSQL = << Date: Fri, 3 Nov 2023 11:54:22 +0100 Subject: [PATCH 3/9] Fix PHPStan and Psalm --- phpstan.neon.dist | 9 +++++++++ psalm.xml.dist | 2 ++ 2 files changed, 11 insertions(+) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index ebda6402cbb..664451feb49 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -140,5 +140,14 @@ parameters: # Ignore the possible false return value of db2_num_rows(). - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Connection\:\:exec\(\) should return int but returns int<0, max>\|false\.$~' - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Result\:\:rowCount\(\) should return int but returns int<0, max>\|false\.$~' + + # https://github.com/doctrine/dbal/pull/6202 + # TODO: remove in 4.0.0 + - '~^Method Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform\:\:getColumnTypeSQLSnippets\(\) invoked with 2 parameters, 0-1 required\.\z~' + - + message: '~^PHPDoc tag \@param references unknown parameter\: \$databaseName$~' + paths: + - src/Platforms/AbstractMySQLPlatform.php + - src/Platforms/MariaDb1043Platform.php includes: - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/psalm.xml.dist b/psalm.xml.dist index 567ecc381ae..dff9b2c03bb 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -791,6 +791,8 @@ + + From 82d8266551ffa10dad6b5542eff980dc9002b867 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 5 Nov 2023 19:10:22 +0100 Subject: [PATCH 4/9] Deprecate and replace getColumnTypeSQLSnippets() --- phpstan.neon.dist | 9 --------- psalm.xml.dist | 7 +++++-- src/Platforms/AbstractMySQLPlatform.php | 25 +++++++++++++++++++++---- src/Platforms/MariaDb1043Platform.php | 17 ++++------------- src/Schema/MySQLSchemaManager.php | 1 + 5 files changed, 31 insertions(+), 28 deletions(-) diff --git a/phpstan.neon.dist b/phpstan.neon.dist index 664451feb49..ebda6402cbb 100644 --- a/phpstan.neon.dist +++ b/phpstan.neon.dist @@ -140,14 +140,5 @@ parameters: # Ignore the possible false return value of db2_num_rows(). - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Connection\:\:exec\(\) should return int but returns int<0, max>\|false\.$~' - '~^Method Doctrine\\DBAL\\Driver\\IBMDB2\\Result\:\:rowCount\(\) should return int but returns int<0, max>\|false\.$~' - - # https://github.com/doctrine/dbal/pull/6202 - # TODO: remove in 4.0.0 - - '~^Method Doctrine\\DBAL\\Platforms\\AbstractMySQLPlatform\:\:getColumnTypeSQLSnippets\(\) invoked with 2 parameters, 0-1 required\.\z~' - - - message: '~^PHPDoc tag \@param references unknown parameter\: \$databaseName$~' - paths: - - src/Platforms/AbstractMySQLPlatform.php - - src/Platforms/MariaDb1043Platform.php includes: - vendor/phpstan/phpstan-strict-rules/rules.neon diff --git a/psalm.xml.dist b/psalm.xml.dist index dff9b2c03bb..33db79378c0 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -499,6 +499,11 @@ --> + + @@ -791,8 +796,6 @@ - - diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 6c1dbbd82a8..102c567c272 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -398,17 +398,34 @@ public function getListTableColumnsSQL($table, $database = null) } /** + * @deprecated Use {@see getColumnTypeSQLSnippet()} instead. + * * The SQL snippets required to elucidate a column type * * Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet] * - * @param string|null $databaseName - * * @return array{string, string} */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c' /* , ?string $databaseName = null*/): array + public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array + { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6202', + 'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. ' + . 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.', + ); + + return [$this->getColumnTypeSQLSnippet(...func_get_args()), '']; + } + + /** + * The SQL snippet required to elucidate a column type + * + * Returns a column type SELECT snippet string + */ + public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $databaseName = null): string { - return [$tableAlias . '.COLUMN_TYPE', '']; + return $tableAlias . '.COLUMN_TYPE'; } /** @deprecated The SQL used for schema introspection is an implementation detail and should not be relied upon. */ diff --git a/src/Platforms/MariaDb1043Platform.php b/src/Platforms/MariaDb1043Platform.php index ae5ce164220..8ba6792ed01 100644 --- a/src/Platforms/MariaDb1043Platform.php +++ b/src/Platforms/MariaDb1043Platform.php @@ -4,8 +4,6 @@ use Doctrine\DBAL\Types\JsonType; -use function func_get_arg; -use function func_num_args; use function sprintf; /** @@ -42,6 +40,7 @@ public function getJsonTypeDeclarationSQL(array $column): string */ public function getListTableColumnsSQL($table, $database = null): string { + // @todo 4.0 - call getColumnTypeSQLSnippet() instead [$columnTypeSQL, $joinCheckConstraintSQL] = $this->getColumnTypeSQLSnippets('c', $database); return sprintf( @@ -75,23 +74,17 @@ public function getListTableColumnsSQL($table, $database = null): string * as JSON where it was originally specified as such instead of LONGTEXT. * * The CHECK constraints are stored in information_schema.CHECK_CONSTRAINTS so query that table. - * - * @param string|null $databaseName - * - * @return array{string, string} */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c' /* , ?string $databaseName = null*/): array + public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $databaseName = null): string { - $databaseName = func_num_args() > 1 ? func_get_arg(1) : null; - if ($this->getJsonTypeDeclarationSQL([]) !== 'JSON') { - return parent::getColumnTypeSQLSnippets($tableAlias, $databaseName); + return parent::getColumnTypeSQLSnippet($tableAlias, $databaseName); } $databaseName = $this->getDatabaseNameSQL($databaseName); // The check for `CONSTRAINT_SCHEMA = $databaseName` is mandatory here to prevent performance issues - $columnTypeSQL = <<_platform->getColumnTypeSQLSnippets('c', $databaseName); $sql = 'SELECT'; From f2758ffe21daa8ce5c22fff0c2490b01799759a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 5 Nov 2023 19:32:27 +0100 Subject: [PATCH 5/9] Revert deprecation --- psalm.xml.dist | 5 ----- src/Platforms/AbstractMySQLPlatform.php | 9 --------- 2 files changed, 14 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index 33db79378c0..567ecc381ae 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -499,11 +499,6 @@ --> - - diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 102c567c272..284194d9dc7 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -398,8 +398,6 @@ public function getListTableColumnsSQL($table, $database = null) } /** - * @deprecated Use {@see getColumnTypeSQLSnippet()} instead. - * * The SQL snippets required to elucidate a column type * * Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet] @@ -408,13 +406,6 @@ public function getListTableColumnsSQL($table, $database = null) */ public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6202', - 'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. ' - . 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.', - ); - return [$this->getColumnTypeSQLSnippet(...func_get_args()), '']; } From 0376c0f3b99d0ec67eb3c2ed78eacde95a09a579 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 5 Nov 2023 19:39:05 +0100 Subject: [PATCH 6/9] Deprecate AbstractMySQLPlatform::getColumnTypeSQLSnippet --- psalm.xml.dist | 5 +++++ src/Platforms/AbstractMySQLPlatform.php | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/psalm.xml.dist b/psalm.xml.dist index bfeea5a7222..eb12a6885fc 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -506,6 +506,11 @@ + + diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 284194d9dc7..485d4d8bb8e 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -398,6 +398,8 @@ public function getListTableColumnsSQL($table, $database = null) } /** + * @deprecated Use {@see getColumnTypeSQLSnippet()} instead. + * * The SQL snippets required to elucidate a column type * * Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet] @@ -406,6 +408,13 @@ public function getListTableColumnsSQL($table, $database = null) */ public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array { + Deprecation::triggerIfCalledFromOutside( + 'doctrine/dbal', + 'https://github.com/doctrine/dbal/pull/6202', + 'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. ' + . 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.', + ); + return [$this->getColumnTypeSQLSnippet(...func_get_args()), '']; } From 8ecd6ba924b10b6f1bb3755b54f7da8916c9eae1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 5 Nov 2023 20:01:12 +0100 Subject: [PATCH 7/9] Remove AbstractMySQLPlatform::getColumnTypeSQLSnippets() --- psalm.xml.dist | 6 ----- src/Platforms/AbstractMySQLPlatform.php | 23 +------------------ src/Platforms/MariaDBPlatform.php | 4 ++-- src/Schema/MySQLSchemaManager.php | 4 +--- .../Schema/MySQLSchemaManagerTest.php | 4 ++-- 5 files changed, 6 insertions(+), 35 deletions(-) diff --git a/psalm.xml.dist b/psalm.xml.dist index 49367003749..fa949b53ddd 100644 --- a/psalm.xml.dist +++ b/psalm.xml.dist @@ -44,12 +44,6 @@ - - - diff --git a/src/Platforms/AbstractMySQLPlatform.php b/src/Platforms/AbstractMySQLPlatform.php index 86a3c7e6956..de09083ae95 100644 --- a/src/Platforms/AbstractMySQLPlatform.php +++ b/src/Platforms/AbstractMySQLPlatform.php @@ -207,33 +207,12 @@ public function supportsColumnCollation(): bool return true; } - /** - * @deprecated Use {@see getColumnTypeSQLSnippet()} instead. - * - * The SQL snippets required to elucidate a column type - * - * Returns an array of the form [column type SELECT snippet, additional JOIN statement snippet] - * - * @return array{string, string} - */ - public function getColumnTypeSQLSnippets(string $tableAlias = 'c'): array - { - Deprecation::triggerIfCalledFromOutside( - 'doctrine/dbal', - 'https://github.com/doctrine/dbal/pull/6202', - 'AbstractMySQLPlatform::getColumnTypeSQLSnippets() is deprecated. ' - . 'Use AbstractMySQLPlatform::getColumnTypeSQLSnippet() instead.', - ); - - return [$this->getColumnTypeSQLSnippet(...func_get_args()), '']; - } - /** * The SQL snippet required to elucidate a column type * * Returns a column type SELECT snippet string */ - public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $databaseName = null): string + public function getColumnTypeSQLSnippet(string $tableAlias, string $databaseName): string { return $tableAlias . '.COLUMN_TYPE'; } diff --git a/src/Platforms/MariaDBPlatform.php b/src/Platforms/MariaDBPlatform.php index b1ee01c22b0..a92b0cc0452 100644 --- a/src/Platforms/MariaDBPlatform.php +++ b/src/Platforms/MariaDBPlatform.php @@ -42,13 +42,13 @@ public function getJsonTypeDeclarationSQL(array $column): string * * The CHECK constraints are stored in information_schema.CHECK_CONSTRAINTS so query that table. */ - public function getColumnTypeSQLSnippet(string $tableAlias = 'c', ?string $databaseName = null): string + public function getColumnTypeSQLSnippet(string $tableAlias, string $databaseName): string { if ($this->getJsonTypeDeclarationSQL([]) !== 'JSON') { return parent::getColumnTypeSQLSnippet($tableAlias, $databaseName); } - $databaseName = $this->getDatabaseNameSQL($databaseName); + $databaseName = $this->quoteStringLiteral($databaseName); // The check for `CONSTRAINT_SCHEMA = $databaseName` is mandatory here to prevent performance issues return <<platform->getColumnTypeSQLSnippets('c', $databaseName); + $columnTypeSQL = $this->platform->getColumnTypeSQLSnippet('c', $databaseName); $sql = 'SELECT'; @@ -365,7 +364,6 @@ protected function selectTableColumns(string $databaseName, ?string $tableName = FROM information_schema.COLUMNS c INNER JOIN information_schema.TABLES t ON t.TABLE_NAME = c.TABLE_NAME - $joinCheckConstraintSQL SQL; // The schema name is passed multiple times as a literal in the WHERE clause instead of using a JOIN condition diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php index 6892bbb05a9..99343f3123b 100644 --- a/tests/Functional/Schema/MySQLSchemaManagerTest.php +++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php @@ -394,13 +394,13 @@ public function testJsonColumnType(): void $this->dropAndCreateTable($table); // Remove the comment from the column to ensure the type is detected correctly from the check constraints. - if ($this->connection->getDatabasePlatform() instanceof MariaDb1043Platform) { + if ($this->connection->getDatabasePlatform() instanceof MariaDBPlatform) { $this->connection->executeStatement('ALTER TABLE test_mysql_json CHANGE COLUMN col_json col_json JSON'); } $columns = $this->schemaManager->listTableColumns('test_mysql_json'); - self::assertSame(Types::JSON, $columns['col_json']->getType()->getName()); + self::assertSame(Types::JSON, Type::lookupName($columns['col_json']->getType())); } public function testColumnDefaultCurrentTimestamp(): void From 0b5ddb7779a2e286cb485f1164a322b6af4bded2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Sun, 5 Nov 2023 20:11:39 +0100 Subject: [PATCH 8/9] Document removal --- UPGRADE.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/UPGRADE.md b/UPGRADE.md index 6662e215a47..a50ac5118b9 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -8,6 +8,11 @@ awareness about deprecated code. # Upgrade to 4.0 +## BC BREAK: removed `AbstractMySQLPlatform` methods. + +1. `getColumnTypeSQLSnippets()`, +2. `getDatabaseNameSQL()`. + ## BC BREAK: BIGINT vales are cast to int if possible `BigIntType` casts values retrieved from the database to int if they're inside From dfe3145abe5ed004879a9f93dedf84180f660b8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Auswo=CC=88ger?= Date: Mon, 13 Nov 2023 16:09:18 +0100 Subject: [PATCH 9/9] Removing the comment is no longer neccesary --- tests/Functional/Schema/MySQLSchemaManagerTest.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/tests/Functional/Schema/MySQLSchemaManagerTest.php b/tests/Functional/Schema/MySQLSchemaManagerTest.php index df2d43ea251..2b17b6a25be 100644 --- a/tests/Functional/Schema/MySQLSchemaManagerTest.php +++ b/tests/Functional/Schema/MySQLSchemaManagerTest.php @@ -394,11 +394,6 @@ public function testJsonColumnType(): void $table->addColumn('col_json', Types::JSON); $this->dropAndCreateTable($table); - // Remove the comment from the column to ensure the type is detected correctly from the check constraints. - if ($this->connection->getDatabasePlatform() instanceof MariaDBPlatform) { - $this->connection->executeStatement('ALTER TABLE test_mysql_json CHANGE COLUMN col_json col_json JSON'); - } - $columns = $this->schemaManager->listTableColumns('test_mysql_json'); self::assertInstanceOf(JsonType::class, $columns['col_json']->getType());