Skip to content

Commit 74a268d

Browse files
committed
AC-11816:Add compatibility with MySQL 8.4 LTS
1 parent a2e0ef1 commit 74a268d

File tree

5 files changed

+14
-0
lines changed

5 files changed

+14
-0
lines changed

app/code/Magento/Catalog/etc/db_schema.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@
3131
<index referenceId="CATALOG_PRODUCT_ENTITY_SKU" indexType="btree">
3232
<column name="sku"/>
3333
</index>
34+
<constraint xsi:type="unique" referenceId="CATALOG_PRODUCT_ENTITY_ENTITY_ID">
35+
<column name="entity_id"/>
36+
</constraint>
3437
</table>
3538
<table name="catalog_product_entity_datetime" resource="default" engine="innodb"
3639
comment="Catalog Product Datetime Attribute Backend Table">

app/etc/di.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1858,6 +1858,7 @@
18581858
<arguments>
18591859
<argument name="supportedVersionPatterns" xsi:type="array">
18601860
<item name="MySQL-8" xsi:type="string">^8\.0\.</item>
1861+
<item name="MySQL-8.4" xsi:type="string">^8\.4\.</item>
18611862
<item name="MySQL-5.7" xsi:type="string">^5\.7\.</item>
18621863
<item name="MariaDB-(10.2-10.6)" xsi:type="string">^10\.[2-6]\.</item>
18631864
</argument>

dev/tests/setup-integration/testsuite/Magento/Setup/DeclarativeInstallerTest.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,8 @@ public function testInstallationWithConstraintsModification()
208208
['Magento_TestSetupDeclarationModule1']
209209
);
210210
$this->updateDbSchemaRevision('constraint_modifications');
211+
$adapter = $this->resourceConnection->getConnection("default");
212+
$adapter->query("SET @OLD_RESTRICT_FK_ON_NON_STANDARD_KEY=@@GLOBAL.RESTRICT_FK_ON_NON_STANDARD_KEY, @@GLOBAL.RESTRICT_FK_ON_NON_STANDARD_KEY=0");
211213
$this->cliCommand->upgrade();
212214

213215
$diff = $this->schemaDiff->diff(
@@ -217,6 +219,7 @@ public function testInstallationWithConstraintsModification()
217219
self::assertNull($diff->getAll());
218220
$shardData = $this->describeTable->describeShard(Sharding::DEFAULT_CONNECTION);
219221
$this->assertTableCreationStatements($this->getTrimmedData(), $shardData);
222+
$adapter->query("SET @@GLOBAL.RESTRICT_FK_ON_NON_STANDARD_KEY=IF(@OLD_RESTRICT_FK_ON_NON_STANDARD_KEY=0, 0, 1)");
220223
}
221224

222225
/**

lib/internal/Magento/Framework/DB/Adapter/SqlVersionProvider.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@ class SqlVersionProvider
3535

3636
public const MARIA_DB_10_4_27_VERSION = '10.4.27';
3737

38+
public const MYSQL_8_4_VERSION = '8.4.';
39+
3840
/**#@-*/
3941

4042
/**

lib/internal/Magento/Framework/Test/Unit/DB/Adapter/SqlVersionProviderTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ class SqlVersionProviderTest extends TestCase
4949
*/
5050
private $supportedVersionPatterns = [
5151
'MySQL-8' => '^8\.0\.',
52+
'MySQL-8.4' => '^8\.4\.',
5253
'MySQL-5.7' => '^5\.7\.',
5354
'MariaDB-(10.2-10.6)' => '^10\.[2-6]\.'
5455
];
@@ -126,6 +127,10 @@ public function executeDataProvider(): array
126127
['version' => '8.0.19'],
127128
SqlVersionProvider::MYSQL_8_0_VERSION,
128129
],
130+
'MySQL-8.4' => [
131+
['version' => '8.4.0'],
132+
SqlVersionProvider::MYSQL_8_4_VERSION,
133+
],
129134
'Percona' => [
130135
['version' => '5.7.29-32'],
131136
SqlVersionProvider::MYSQL_5_7_VERSION,

0 commit comments

Comments
 (0)