Skip to content

Commit 671d715

Browse files
committed
Fix mixed up version numbers in check_mysql_version
1 parent 3b58a80 commit 671d715

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

install/lib/installer_base.lib.php

Lines changed: 10 additions & 12 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,28 @@ 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
271-
$min_mysql_version = '5.5';
269+
// Set MariaDB version to 10.0.5 after CentOS 7 support ended to allow preg_* functions in SQL queries
270+
$min_mariadb_version = '5.5';
271+
$min_mysql_version = '8.0.4';
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+
swriteln("Checking MariaDB version " . $version . " .. OK");
285+
if(version_compare($version, $min_mariadb_version, '<')) die("Minimum required MariaDB version is " . $min_mariadb_version . "\n");
286286
} 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");
287+
// We have MySQL or Percona
288+
swriteln("Checking MySQL or compatible version " . $version . " .. OK");
289+
if(version_compare($version, $min_mysql_version, '<')) die("Minimum required MySQL or compatible version is " . $min_mysql_version . "\n");
290290
}
291-
292-
293291
}
294292

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

0 commit comments

Comments
 (0)