Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix retrieving MySQL version for checking as part of install requirem… #17593

Merged
merged 1 commit into from
Jun 13, 2020

Conversation

seamuslee001
Copy link
Contributor

@seamuslee001 seamuslee001 commented Jun 12, 2020

…ents

Overview

This fixes a bug that comes on some MariaDB instances where by the version maybe 10.2 but it gets reported via the mysqli_info as 5.5.5-10.2. This is presently happening on our demo sites
"ERROR: (database) CiviCRM MySQL Version: MySQL version is 5.5.5-10.2.32-MariaDB-10.2.32+maria~stretch; minimum required is 5.6.5"

Before

MySQL DB information doesn't always work correctly for us

After

Correct version returned

ping @eileenmcnaughton @mlutfy

@civibot
Copy link

civibot bot commented Jun 12, 2020

(Standard links)

@civibot civibot bot added the master label Jun 12, 2020
@seamuslee001 seamuslee001 force-pushed the fix_requirements_version branch from 6bccb57 to b18689e Compare June 12, 2020 22:45
@seamuslee001 seamuslee001 force-pushed the fix_requirements_version branch from b18689e to 66c0d0b Compare June 12, 2020 22:48
@seamuslee001
Copy link
Contributor Author

I applied this on the demo sites job and confirmed it fixes the issue on the demo sites https://test.civicrm.org/job/demo.civicrm.org/BLDNAME=d8-master,label=www-demo/2226/console

@@ -307,7 +307,8 @@ public function checkMysqlVersion(array $db_config) {
return $results;
}

if (version_compare($info, $min) == -1) {
$versionDetails = mysqli_query($conn, 'SELECT version() as version')->fetch_assoc();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMHO, it makes perfect sense to use SELECT version() for this.

I asked Seamus what was wrong the previous lookup - he pointed out that mysqli_get_server_info() for MariaDB reports weird values: https://www.php.net/manual/en/mysqli.get-server-info.php#118822

So this change makes sense

@seamuslee001 seamuslee001 merged commit b40526e into civicrm:master Jun 13, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants