Skip to content

Commit 6667462

Browse files
committed
AC-12085:: Add compatibility with MariaDB 11.4 LTS For CE
1 parent 2017f0d commit 6667462

File tree

1 file changed

+23
-3
lines changed
  • dev/tests/integration/framework/Magento/TestFramework/Db

1 file changed

+23
-3
lines changed

dev/tests/integration/framework/Magento/TestFramework/Db/Mysql.php

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,26 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
2323
*/
2424
public const MARIADB_MIN_VERSION = '11.4.';
2525

26+
/**
27+
* MariaDB command.
28+
*/
29+
public const MARIADB_COMMAND = 'mariadb';
30+
31+
/**
32+
* MariaDB Dump command.
33+
*/
34+
public const MARIADB_DUMP_COMMAND = 'mariadb-dump';
35+
36+
/**
37+
* Mysql command.
38+
*/
39+
public const MYSQL_COMMAND = 'mysql';
40+
41+
/**
42+
* Mysql Dump command.
43+
*/
44+
public const MYSQL_DUMP_COMMAND = 'mysqldump';
45+
2646
/**
2747
* Name of configuration file.
2848
*/
@@ -270,7 +290,7 @@ private function isMariaDB(): bool
270290
try {
271291
if (!isset($this->isMariaDB)) {
272292
$version = $this->_shell->execute(
273-
'mariadb-dump --version'
293+
self::MARIADB_DUMP_COMMAND.' --version'
274294
);
275295
$pattern = "/((?:[0-9]+\.?)+)(.*?)(mariadb)/i";
276296
preg_match($pattern, $version !== null ? $version : '', $matches);
@@ -297,7 +317,7 @@ private function isMariaDB(): bool
297317
*/
298318
protected function getDbCommand()
299319
{
300-
return $this->isMariaDB() ? 'mariadb' : 'mysql';
320+
return $this->isMariaDB() ? self::MARIADB_COMMAND : self::MYSQL_COMMAND;
301321
}
302322

303323
/**
@@ -307,6 +327,6 @@ protected function getDbCommand()
307327
*/
308328
protected function getDbDumpCommand()
309329
{
310-
return $this->isMariaDB() ? 'mariadb-dump' : 'mysqldump';
330+
return $this->isMariaDB() ? self::MARIADB_DUMP_COMMAND : self::MYSQL_DUMP_COMMAND;
311331
}
312332
}

0 commit comments

Comments
 (0)