Skip to content

MariadbDialect needs an INSTANCE property. #2060

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
SledgeHammer01 opened this issue May 21, 2025 · 3 comments
Open

MariadbDialect needs an INSTANCE property. #2060

SledgeHammer01 opened this issue May 21, 2025 · 3 comments
Assignees
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@SledgeHammer01
Copy link

SledgeHammer01 commented May 21, 2025

MariaDbDialect extends MySqlDialect, but does not implement it's own public static INSTANCE that returns a MariaDbDialect instance. This makes MariaDbDialect.INSTANCE indistinguishable from MySqlDialect.INSTANCE using instanceof.

We can create it manually, i.e.

new MariaDbDialect(MySqlDialect.MYSQL_IDENTIFIER_PROCESSING)

But it would be nice for MariaDbDialect to have that out of the box. If using a starter, then it would be problematic to create the dialect "the right way".

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label May 21, 2025
@schauder schauder added the type: enhancement A general enhancement label May 22, 2025
@schauder schauder self-assigned this May 22, 2025
@schauder schauder removed the status: waiting-for-triage An issue we've not yet triaged label May 22, 2025
@schauder
Copy link
Contributor

I'm not convinced a singleton instance makes sense for the JdbcMariaDbDialect or related variants, since the IdentifierProcessing for MariaDb is highly dynamic:

From https://mariadb.com/kb/en/identifier-names :

Identifiers may be quoted using the backtick character - `. Quoting is optional for identifiers that don't contain special characters, or for identifiers that are not reserved words. If the ANSI_QUOTES SQL_MODE flag is set, double quotes (") can also be used to quote identifiers. If the MSSQL flag is set, square brackets ([ and ]) can be used for quoting.

From https://mariadb.com/kb/en/identifier-case-sensitivity/ :

Whether objects are case-sensitive or not is partly determined by the underlying operating system. Unix-based systems are case-sensitive, Windows is not, while Mac OS X is usually case-insensitive by default, but devices can be configured as case-sensitive using Disk Utility.

Regarding

If using a starter, then it would be problematic to create the dialect "the right way".

The "correct" is to use the DialectResolver which uses JDBC metadata to determine the correct IdentifierProcessing.

Is there something else I'm missing?

@schauder schauder added the status: waiting-for-feedback We need additional information before we can continue label May 22, 2025
@SledgeHammer01
Copy link
Author

Aren't most of those things true for MySQL too? MySQL and MariaDB are pretty much the same code base. MySQL has a singleton instance.

@spring-projects-issues spring-projects-issues added status: feedback-provided Feedback has been provided and removed status: waiting-for-feedback We need additional information before we can continue labels May 22, 2025
@schauder schauder added status: waiting-for-triage An issue we've not yet triaged and removed type: enhancement A general enhancement status: feedback-provided Feedback has been provided labels May 22, 2025
@schauder
Copy link
Contributor

That is correct, but would be more of an argument for removing that INSTANCE

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants