Skip to content

Commit 85b6119

Browse files
djadobe16glo17680
authored andcommitted
AC-13242::Magento upgrade fails on MariaDB 11.4 + 2.4.8-beta1
1 parent 580e5a1 commit 85b6119

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Db/MySQL/DbSchemaReader.php

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,15 @@ public function getTableOptions($tableName, $resource)
5454
{
5555
$adapter = $this->resourceConnection->getConnection($resource);
5656
$dbName = $this->resourceConnection->getSchemaName($resource);
57+
$collationNameColumn = 'charset_applicability.collation_name';
58+
59+
/* In case of mariadb>=11.4 check if column FULL_COLLATION_NAME is exist */
60+
if($adapter->tableColumnExists('COLLATION_CHARACTER_SET_APPLICABILITY',
61+
'FULL_COLLATION_NAME',
62+
'information_schema')){
63+
$collationNameColumn = 'charset_applicability.full_collation_name';
64+
}
65+
5766
$stmt = $adapter->select()
5867
->from(
5968
['i_tables' => 'information_schema.TABLES'],
@@ -65,7 +74,7 @@ public function getTableOptions($tableName, $resource)
6574
)
6675
->joinInner(
6776
['charset_applicability' => 'information_schema.COLLATION_CHARACTER_SET_APPLICABILITY'],
68-
'i_tables.table_collation = charset_applicability.collation_name',
77+
'i_tables.table_collation = '.$collationNameColumn,
6978
[
7079
'charset' => 'charset_applicability.CHARACTER_SET_NAME'
7180
]

0 commit comments

Comments
 (0)