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

Handle MariaDB independently of MySQL #3530

Closed
wants to merge 1 commit into from

Conversation

amottier
Copy link
Contributor

@amottier amottier commented Oct 1, 2024

Jira URL

This is a partially fix to https://jira.xwiki.org/browse/ADMINTOOL-64

Changes

Description

toProduct method in DatabaseProduct class now returns DatabaseProduct.MARIADB when XWiki is relying on MariaDB instead of returning DatabaseProduct.MYSQL.

Clarifications

So far toProduct method in DatabaseProduct class would reports that a MariaDB database is actually MySQL. This was done on purpose according to XWIKI-17912 description and also according to comments in the code. This decision has some (minors) side effects such as incorrect database type reported to the user in Admin Tools application (cf https://jira.xwiki.org/browse/ADMINTOOL-64). This commit is an attempt to handle MariaDB independently of MySQL.

The single existing test impact by this change has been update but some additional tests are probably required to increase the confidence in those changes.

Executed Tests

All unit tests of xwiki-platform project were executed.

Expected merging strategy

  • Prefers squash: Yes
  • Backport on branches: No

So far `toProduct` method in `DatabaseProduct` class would reports that a MariaDB database is actually MySQL.
This was done on purpose according to [XWIKI-17912](https://jira.xwiki.org/browse/XWIKI-17912) description and also according to comments in the code.
This decision has some (minors) side effects such as incorrect database type reported to the user in Admin Tools application (cf https://jira.xwiki.org/browse/ADMINTOOL-64).
This commit is an attempt to handle MariaDB independently of MySQL. The single existing test impact by this change has been update but some additional tests are probably required to increase the confidence in those changes.
product = MYSQL;
} else if (matches(productNameOrJDBCScheme, MARIADB)) {
Copy link
Member

Choose a reason for hiding this comment

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

I'm not a fan of this. It means that any code which does something specific for MySQL/MariaDB will be broken because the type won't be = MYSQL anymore.

To me, MariaDB and MySQL are not different enough from query behavior point of view to justify this very risky change.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I totally agree with your feedback.

I tried, in this pull request, to make sure to update all code that might relies on the database being MySQL/MariaDB but I cannot be 100% confident on covering all the code (especially if constant defined in DatabaseProduct are not used). So I'm closing this pull request.

In order to solve my issue in Admin Tools, I created another pull request that modify the code of the extension rather than the code of the platform.
This should be far less risky.

@amottier amottier closed this Oct 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants