Skip to content

Commit 994a047

Browse files
author
Till Brehm
committed
Merge branch 'fix-sql-versions-in-check' into 'develop'
Fix mixed up version numbers in check_mysql_version See merge request ispconfig/ispconfig3!1750
2 parents 934ad8a + 35f449d commit 994a047

File tree

1 file changed

+15
-11
lines changed

1 file changed

+15
-11
lines changed

install/lib/installer_base.lib.php

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ public function find_installed_apps() {
247247
//** Check prerequisites
248248
public function check_prerequisites() {
249249
global $conf;
250-
250+
251251
$msg = '';
252252

253253
if ($conf['default_php'] != '') {
@@ -266,30 +266,34 @@ public function check_prerequisites() {
266266
public function check_mysql_version() {
267267
global $conf;
268268

269-
$min_mariadb_version = '10.0.5';
270-
// Set MySQL version to 8.0.4 after CentOS 7 support ended to allow preg_* functions in SQL queries
269+
// Set MariaDB version to 10.0.5 and MySQL version to 8.0.4 after CentOS 7 support ended to allow preg_* functions in SQL queries
270+
$min_mariadb_version = '5.5';
271271
$min_mysql_version = '5.5';
272272

273273
$rec = $this->db->queryOneRecord('SELECT VERSION() as mysql_version');
274274
if(is_array($rec)) {
275275
$version = $rec['mysql_version'];
276276
} else {
277-
die("Unable to get MySQL version\n");
277+
die("Unable to get MySQL or compatible version\n");
278278
}
279279

280280
if(strpos($version,'MariaDB')) {
281281
// We have MariaDB
282282
$parts = explode('-',$version);
283283
$version = $parts[0];
284-
swriteln("MariaDB version ".$version);
285-
if(version_compare($version, $min_mariadb_version, '<')) die("Minimum required MariaDB version is ".$min_mariadb_version."\n");
284+
if(version_compare($version, $min_mariadb_version, '<')) {
285+
die("Minimum required MariaDB version is " . $min_mariadb_version . ",found " . $version . "\n");
286+
} else {
287+
swriteln("Checking MariaDB version " . $version . " .. OK");
288+
}
286289
} else {
287-
// we have MySQL
288-
swriteln("MySQL version ".$version);
289-
if(version_compare($version, $min_mysql_version, '<')) die("Minimum required MySQL version is ".$min_mysql_version."\n");
290+
// We have MySQL or Percona
291+
if(version_compare($version, $min_mysql_version, '<')) {
292+
die("Minimum required MySQL or compatible version is " . $min_mysql_version . ",found " . $version . "\n");
293+
} else {
294+
swriteln("Checking MySQL or compatible version " . $version . " .. OK");
295+
}
290296
}
291-
292-
293297
}
294298

295299
public function force_configure_app($service, $enable_force=true) {

0 commit comments

Comments
 (0)