Skip to content

Commit f46bdfc

Browse files
committed
AC-12085:: Have handled mariadb mininum version to use mariadb comands instead mysql
1 parent 70d75d8 commit f46bdfc

File tree

1 file changed

+14
-0
lines changed
  • dev/tests/integration/framework/Magento/TestFramework/Db

1 file changed

+14
-0
lines changed

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

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ class Mysql extends \Magento\TestFramework\Db\AbstractDb
1818
*/
1919
const DEFAULT_PORT = 3306;
2020

21+
/**
22+
* MariaDB minimum version.
23+
*/
24+
const MARIADB_MIN_VERSION = '11.4.';
25+
2126
/**
2227
* Name of configuration file.
2328
*/
@@ -279,6 +284,15 @@ private function isMariaDB(): bool
279284
);
280285

281286
$this->isMariaDB = (bool) preg_match('/-MariaDB/i', $version);
287+
288+
if($this->isMariaDB){
289+
$pattern = "/\s*((?:[0-9]+\.?)+)/i";
290+
preg_match($pattern, $version,$matches);
291+
$currentVersion = $matches[1];
292+
if (!version_compare($currentVersion, self::MARIADB_MIN_VERSION, '>=')) {
293+
$this->isMariaDB = false;
294+
}
295+
}
282296
}
283297
} catch (LocalizedException $e) {
284298
$this->isMariaDB = false;

0 commit comments

Comments
 (0)