Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

fix(install): check mariaDB version before using ALTER USER #8068

Merged
merged 2 commits into from
Nov 5, 2019

Conversation

sc979
Copy link
Contributor

@sc979 sc979 commented Oct 28, 2019

Pull Request Template

Description

As the Centreon wasn't released with the mariaDB 10.2 as expected, the MySQL 8.0 modifications are incompatible with mariaDB 10.1.
As the ALTER USER clause were introduced on the mariaDB 10.2.
Resulting in an error blocking the installation script on a fresh install

Fixes # (blocking)

Type of change

  • Patch fixing an issue (non-breaking change)
  • New functionality (non-breaking change)
  • Breaking change (patch or feature) that might cause side effects breaking part of the Software
  • Updating documentation (missing information, typo...)

Target serie

  • 2.8.x
  • 18.10.x
  • 19.04.x
  • 19.10.x
  • 20.04.x (master)

How this pull request can be tested ?

Try to install a fresh install using the current RPM -> an error occurs and you can't acheive the installation
Apply the fix, then try again -> The installation should work as expected

Checklist

Community contributors & Centreon team

  • I followed the coding style guidelines provided by Centreon
  • I have commented my code, especially new classes, functions or any legacy code modified. (docblock)
  • I have commented my code, especially hard-to-understand areas of the PR.
  • I have made corresponding changes to the documentation.
  • I have rebased my development branch on the base branch (master, maintenance).

Centreon team only

  • I have made sure that the unit tests related to the story are successful.
  • I have made sure that unit tests cover 80% of the code written for the story.
  • I have made sure that acceptance tests related to the story are successful (local and CI)

$versionName = $row['version_comment'];
}
}
if ((strpos($versionName, "MariaDB") !== false && version_compare($versionNumber, '10.2.0') >= 0)
Copy link
Contributor Author

@sc979 sc979 Oct 28, 2019

Choose a reason for hiding this comment

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

I'm not sure that we need to ALTER the centreon's user, on a MariaDB, as the deprecated "plugin" problem may affect only mysql >= 8.0

@sc979 sc979 merged commit 771dc5c into master Nov 5, 2019
@sc979 sc979 deleted the MON-installation-alter-user-for-mariadb-10-1 branch November 5, 2019 10:28
sc979 added a commit that referenced this pull request Nov 5, 2019
* fix(install): avoid trying to use the ALTER USER on a mariaDB < 10.2

* enh(BE): remove the useless prepare statement
sc979 added a commit that referenced this pull request Nov 6, 2019
* fix(install): avoid trying to use the ALTER USER on a mariaDB < 10.2

* enh(BE): remove the useless prepare statement
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants