Skip to content

Add FAQ for case sensitivity problem with MySQL #6127

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

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

fusawa-yugo
Copy link
Contributor

Motivation

An error with MySQL was report in #6032.
Following an internal discussion, we decided to add a description of the issue and its possible workarounds to the FAQ.

Description of the changes

The output is like:
スクリーンショット 2025-06-04 18 12 51

Copy link
Contributor

@nabenabe0928 nabenabe0928 left a comment

Choose a reason for hiding this comment

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

Thank you for the PR, I left some comments:)

@@ -775,3 +775,32 @@ However, if it is necessary to remove artifacts from a Python script, users can
for artifact_meta in get_all_artifact_meta(study):
# Remove the artifacts uploaded to ``base_path``.
artifact_store.remove(artifact_meta.artifact_id)

How can I resolve case sensitivity issues with MySQL?
------------------------------------------------------
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
------------------------------------------------------
-----------------------------------------------------

Comment on lines +783 to +784
However, Optuna treats string parameters in a case-sensitive manner.
This can lead to conflicts when parameter names differ only by case.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
However, Optuna treats string parameters in a case-sensitive manner.
This can lead to conflicts when parameter names differ only by case.
However, Optuna treats string parameters in a case-sensitive manner, leading to conflicts in MySQL if parameter names differ only by case.

A = trial.suggest_int("A", 0, 10)
return a + A

In this case, "a" and "A" are treated as distinct by Optuna, but MySQL considers them the same due to its default collation settings.
Copy link
Contributor

@nabenabe0928 nabenabe0928 Jun 6, 2025

Choose a reason for hiding this comment

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

Suggested change
In this case, "a" and "A" are treated as distinct by Optuna, but MySQL considers them the same due to its default collation settings.
In this case, Optuna treats `a` and `A` distinctively while MySQL does not due to its default collation settings.

return a + A

In this case, "a" and "A" are treated as distinct by Optuna, but MySQL considers them the same due to its default collation settings.
As a result, an error may occur when trying to register these parameters in the database.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
As a result, an error may occur when trying to register these parameters in the database.
As a result, only one of the parameters will be registered in MySQL.

In this case, "a" and "A" are treated as distinct by Optuna, but MySQL considers them the same due to its default collation settings.
As a result, an error may occur when trying to register these parameters in the database.

To address this issue, there are some workarounds.
Copy link
Contributor

@nabenabe0928 nabenabe0928 Jun 6, 2025

Choose a reason for hiding this comment

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

Suggested change
To address this issue, there are some workarounds.
The following workarounds should be considered:

1. Use a different storage backend.
Please consider using PostgreSQL or SQLite, which supports case-sensitive handling.
2. Rename the parameters to avoid case conflicts.
For example, use "a" and "b" instead of "a" and "A".
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For example, use "a" and "b" instead of "a" and "A".
For example, use `a` and `b` instead of `a` and `A`.

For example, use "a" and "b" instead of "a" and "A".
3. Change MySQL’s collation settings to be case-sensitive.
You can configure case sensitivity at the database, table, or column level.
For more details, refer to `the MySQL documentation <https://dev.mysql.com/doc/refman/9.3/en/charset-syntax.html>`__.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
For more details, refer to `the MySQL documentation <https://dev.mysql.com/doc/refman/9.3/en/charset-syntax.html>`__.
We defer to `the MySQL documentation <https://dev.mysql.com/doc/refman/9.3/en/charset-syntax.html>`__ for more details.

@nabenabe0928 nabenabe0928 self-assigned this Jun 6, 2025
@nabenabe0928 nabenabe0928 added the document Documentation related. label Jun 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
document Documentation related.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants