-
Notifications
You must be signed in to change notification settings - Fork 203
Permit connection to MariaDB 10.10 #51
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
Conversation
Driver cannot even connect to MariaDB 10.10+, connection fails with error : ``` [InvalidCastException: Object cannot be cast from DBNull to other types.] System.DBNull.System.IConvertible.ToInt32(IFormatProvider provider) +57 MySql.Data.MySqlClient.Driver.LoadCharacterSets(MySqlConnection connection) +557 MySql.Data.MySqlClient.Driver.Configure(MySqlConnection connection) +200 MySql.Data.MySqlClient.MySqlConnection.Open() +1341 ``` the reason is MariaDB 10.10 supports Unicode 14 with Collations that can have null id/null characters: ```sql show collation where COLLATION like 'uca14%'; +--------------------------------+---------+------+---------+----------+---------+ | Collation | Charset | Id | Default | Compiled | Sortlen | +--------------------------------+---------+------+---------+----------+---------+ | uca1400_ai_ci | NULL | NULL | NULL | Yes | 8 | | uca1400_ai_cs | NULL | NULL | NULL | Yes | 8 | | uca1400_as_ci | NULL | NULL | NULL | Yes | 8 | | uca1400_as_cs | NULL | NULL | NULL | Yes | 8 | ... ``` collation ids depends on charset (see in I_S.COLLATION_CHARACTER_SET_APPLICABILITY) ``sql SELECT * FROM INFORMATION_SCHEMA.COLLATION_CHARACTER_SET_APPLICABILITY WHERE COLLATION_NAME LIKE 'uca1400_ai_ci'; +----------------+--------------------+-----------------------+------+------------+ | COLLATION_NAME | CHARACTER_SET_NAME | FULL_COLLATION_NAME | ID | IS_DEFAULT | +----------------+--------------------+-----------------------+------+------------+ | uca1400_ai_ci | utf8mb3 | utf8mb3_uca1400_ai_ci | 2048 | | | uca1400_ai_ci | ucs2 | ucs2_uca1400_ai_ci | 2560 | | | uca1400_ai_ci | utf8mb4 | utf8mb4_uca1400_ai_ci | 2304 | | | uca1400_ai_ci | utf16 | utf16_uca1400_ai_ci | 2816 | | | uca1400_ai_ci | utf32 | utf32_uca1400_ai_ci | 3072 | | +----------------+--------------------+-----------------------+------+------------+ ``` (Description is more complex than the fix)
Hi, thank you for submitting this pull request. In order to consider your code we need you to sign the Oracle Contribution Agreement (OCA). Please review the details and follow the instructions at https://oca.opensource.oracle.com/ |
Hi, thank you for your contribution. Please confirm this code is submitted under the terms of the OCA (Oracle's Contribution Agreement) you have previously signed by cutting and pasting the following text as a comment: |
I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it. |
This PR helped us making a hotifx-package into our local nuget repository. I would appreciate having the official fix at nuget.org. |
Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow |
Mysql Connector has become unusable on MariaDB 10.10.1+ without this fix, would appreciate it pushing through to the main release. Thanks @rusher for the fix. |
Are there any updates regarding this fix? |
Up, this is a blocking issue |
I doubt anyone's reading this thread, comments are probably better posted on http://bugs.mysql.com/bug.php?id=110898 (I am also awaiting this to make its way to the next release, it's blocking our upgrade to Debian 12) |
A potential workaround for anyone affected by this bug is to switch to the alternative ADO.NET library: https://github.com/mysql-net/MySqlConnector, https://mysqlconnector.net/tutorials/migrating-from-connector-net/ (Disclaimer: I am the lead author of MySqlConnector) |
Does MySqlConnector support session parameters? |
@alexbn71 You should ask questions about MySqlConnector at its repo: https://github.com/mysql-net/MySqlConnector/discussions (And, yes it does.) |
Alguien sabe si esto, ya entro en alguna version, he intentado cambiar a MySql Connector, pero me genera otro error el cual no he encontrado solucion. |
Still no fix for this issue. |
MariaDB is compatible now, add a trick for MySQL.Data connector (see https://jira.mariadb.org/browse/MDEV-31608) but this need MariaDB 10.11.7+ version, not 10.10 |
It's probably worth moving to MySqlConnector, as quoted in this thread here https://bugs.mysql.com/bug.php?id=109331 the .NET connector from the MySQL Dev team now focuses only on MySQL and not any developments in MariaDB:
This problem will not be fixed by the official release. |
Driver cannot even connect to MariaDB 10.10+, connection fails with error :
the reason is MariaDB 10.10 supports Unicode 14 with Collations that can have null id/null characters:
Since 10.10, some collation have null id in
I_S.COLLATIONS
/SHOW COLLATIONS
.ID's only appear in I_S.COLLATION_CHARACTER_SET_APPLICABILITY, associate to charset.
example:
This simple fix correct this connection problem