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

Add MySQL8Dialect and MySQL8InnoDBDialect #3236

Merged
merged 2 commits into from
Jul 5, 2023

Conversation

dennis-gr
Copy link
Contributor

@dennis-gr dennis-gr commented Feb 10, 2023

MySQL 8 is deprecating integer display widths, see here and here for more information.

The MySQL8Dialect uses BOOLEAN instead of TINYINT(1) for DbType.Boolean.

Copy link
Member

@fredericDelaporte fredericDelaporte left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution. It seems to me it misses the point you were willing to address, display width being deprecated for integers types.

@dennis-gr
Copy link
Contributor Author

No, it actually needs to be BOOLEAN since TINYINT(1) is treated differently by connectors. Because of this, TINYINT(1) is probably the only case where specifiying the display width is/was actually useful.

You can verify this yourself:

mysql> create table a (b TINYINT(1));
Query OK, 0 rows affected, 1 warning (0.00 sec)

mysql> show warnings;
+---------+------+------------------------------------------------------------------------------+
| Level   | Code | Message                                                                      |
+---------+------+------------------------------------------------------------------------------+
| Warning | 1681 | Integer display width is deprecated and will be removed in a future release. |
+---------+------+------------------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> create table b (c BOOLEAN);
Query OK, 0 rows affected (0.00 sec)

mysql> show warnings;
Empty set (0.00 sec)

@fredericDelaporte
Copy link
Member

According to your link, the connector documentation tell to use BOOL. It do not seem to tell anything about BOOLEAN. So, should the mapping use BOOL instead, just in case?

@dennis-gr
Copy link
Contributor Author

Since the official MySQL documentation specifies that both BOOL and BOOLEAN are valid, I think it's fine to leave it as is.

@hazzik hazzik enabled auto-merge (squash) July 5, 2023 03:30
@hazzik hazzik added the r: Fixed label Jul 5, 2023
@hazzik hazzik merged commit 1cfead7 into nhibernate:master Jul 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants