Skip to content

Commit 4cd541e

Browse files
committed
AC-7469:Add support for MySQL8.0.29 and higher
1 parent 38f349d commit 4cd541e

File tree

1 file changed

+22
-2
lines changed
  • lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories

1 file changed

+22
-2
lines changed

lib/internal/Magento/Framework/Setup/Declaration/Schema/Dto/Factories/Table.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ class Table implements FactoryInterface
3939
/** @var SqlVersionProvider|null */
4040
private ?SqlVersionProvider $sqlVersionProvider = null;
4141

42+
/**
43+
* @var string|null
44+
*/
45+
private ?string $sqlVersion = null;
46+
4247
/**
4348
* @var array|string[]
4449
*/
@@ -122,7 +127,8 @@ private function getDefaultCharset(): string
122127
if ($this->sqlVersionProvider->isMysqlGte8029()) {
123128
return self::$defaultCharset['mysql_8_29'];
124129
}
125-
return self::$defaultCharset[$this->sqlVersionProvider->getSqlVersion()] ??
130+
131+
return self::$defaultCharset[$this->getSqlVersion()] ??
126132
self::$defaultCharset['default'];
127133
}
128134

@@ -137,7 +143,21 @@ private function getDefaultCollation(): string
137143
return self::$defaultCollation['mysql_8_29'];
138144
}
139145

140-
return self::$defaultCollation[$this->sqlVersionProvider->getSqlVersion()] ??
146+
return self::$defaultCollation[$this->getSqlVersion()] ??
141147
self::$defaultCollation['default'];
142148
}
149+
150+
/**
151+
* Get sql version
152+
*
153+
* @return string
154+
*/
155+
private function getSqlVersion(): string
156+
{
157+
if ($this->sqlVersion === null) {
158+
$this->sqlVersion = $this->sqlVersionProvider->getSqlVersion();
159+
}
160+
161+
return $this->sqlVersion;
162+
}
143163
}

0 commit comments

Comments
 (0)