-
Notifications
You must be signed in to change notification settings - Fork 205
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)
mysql-oca-bot
commented
Apr 24, 2023
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/
Please make sure to include your MySQL bug system user (email) in the returned form.
Thanks
mysql-oca-bot
commented
May 2, 2023
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."
Thanks
I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
unglaublicherdude
commented
May 2, 2023
This PR helped us making a hotifx-package into our local nuget repository. I would appreciate having the official fix at nuget.org.
@rusher thank's for the work!
mysql-oca-bot
commented
May 3, 2023
Hi, thank you for your contribution. Your code has been assigned to an internal queue. Please follow
bug http://bugs.mysql.com/bug.php?id=110898 for updates.
Thanks
alvaromarithompson
commented
Jun 19, 2023
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.
perplexityjeff
commented
Sep 20, 2023
Are there any updates regarding this fix?
JeanRessouche
commented
Sep 20, 2023
Up, this is a blocking issue
alvaromarithompson
commented
Sep 20, 2023
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)
bgrainger
commented
Sep 26, 2023
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)
alexbn71
commented
Sep 29, 2023
Does MySqlConnector support session parameters?
bgrainger
commented
Sep 30, 2023
@alexbn71 You should ask questions about MySqlConnector at its repo: https://github.com/mysql-net/MySqlConnector/discussions
(And, yes it does.)
sistemasIHS
commented
Feb 9, 2024
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.
alvaromarithompson
commented
Mar 20, 2024
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:
MySQL and MariaDB are diverging products and compatibility is no longer guaranteed and is not a common objective of both projects.
MariaDB is not a drop-in replacement of MySQL anymore.
Storage engines, protocol, etc.. all are going in different directions.
Therefore MySQL Connectors are developed with MySQL Server (Community, Enterprise) focus.
This problem will not be fixed by the official release.
Uh oh!
There was an error while loading. Please reload this page.
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