[MDEV-31608] MySQL.Data can not connect to MariaDB 11 due a collations with a NULL id. Created: 2023-07-03  Updated: 2023-12-08  Resolved: 2023-11-30

Status: Closed
Project: MariaDB Server
Component/s: Server
Affects Version/s: 10.10, 10.11, 11.0, 11.1, 11.2
Fix Version/s: 10.11.7, 11.0.5, 11.1.4, 11.2.3

Type: Bug Priority: Blocker
Reporter: Moshe L Assignee: Vladislav Vaintroub
Resolution: Fixed Votes: 1
Labels: .net, collation
Environment:

Windows, Linux


Issue Links:
Duplicate
is duplicated by MDEV-32816 Make "show collations" data not-nullable Closed
is duplicated by MDEV-32865 Get datas from Table Closed
Problem/Incident
is caused by MDEV-27009 Add UCA-14.0.0 collations Closed
Relates
relates to MDEV-24121 Recent MariaDB update appears to have... Closed

 Description   

I am working with 11.0.2 and (varios clients, one of them is ) MySQL.Data.MySQLConnector.

The new feature for multiple collations with NULL ID (MDEV-27009) broke the connector as you can see here:

https://stackoverflow.com/questions/74060289/mysqlconnection-open-system-invalidcastexception-object-cannot-be-cast-from-d

I know the problem is in the connector internals, but how I can disable the new collations to make the connection connect until they will fix it ?

Thanks for a must-using product !

https://i.stack.imgur.com/zGwvA.png



 Comments   
Comment by Diego Dupin [ 2023-07-03 ]

This is a problem with 10.10+ normally, not 10.9, right ?

There is some pull request for that : https://github.com/mysql/mysql-connector-net/pull/51 , handled in mysql tracker https://bugs.mysql.com/bug.php?id=110898, but there has not been any release since.

The recommanded driver is the community driver https://github.com/mysql-net/MySqlConnector ( nuget MySqlConnector) is compatible (and way faster, even not talking about mariadb specific implementation permitting faster prepared statement)

Comment by Moshe L [ 2023-07-03 ]

Yes the MySqlConnector is much better. but in one project I am stuck with the Oracle one as I need an specific integration with it.

Thanks.

Comment by Vladislav Vaintroub [ 2023-10-07 ]

This is not likely to be fixed by Oracle, even if they have a patch. Their position is declared by Frederic Descamps in the corresponding bug
https://bugs.mysql.com/bug.php?id=109331, which is closed as "Unsupported"

[11 Dec 2022 13:33] Frederic Descamps
Hi Ivaylo, 
 
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.
 
Regards,

That Oracle can use this as leverage, and spread some FUD does not sound great and whatever Frederic has said not factually true - it is our objective to keep connector compatibility. I firmly think it should be have been fixed by us, in the server, once found, and this is close to year ago (and of course, should have been tested by us prior to release). Not everyone can switch to the arguably better MySqlConnector, and stackoverflow answers highlight that.

Comment by Vladislav Vaintroub [ 2023-10-08 ]

Hi Serg,
could you please review https://github.com/MariaDB/server/commit/d25ab9fdfa1b544a6be97ce3303c05cac73b88e7 ?
Thanks!

The added test main.mysql_connector_net passes on the required builder amd64-windows, where I installed the MySQL Connector/NET 8.1, and is skipped everywhere else now.

Comment by Sergei Golubchik [ 2023-10-13 ]

https://bugs.mysql.com/bug.php?id=110898 is not closed yet

Comment by Vladislav Vaintroub [ 2023-10-13 ]

https://bugs.mysql.com/bug.php?id=110898 is not closed, but it is reported half a year ago and 2 major connector releases were produced. https://bugs.mysql.com/bug.php?id=109331 is closed as "Unsupported". There is currently no version of Connector/NET that would work with our long-term release 10.11 (and everything short-term from 10.10 to 11.3)

Comment by Vladislav Vaintroub [ 2023-10-13 ]

A quick search on the web reveals that we also broke - Toad Data Point, PowerBI, and OnlyOffice.

Comment by Vladislav Vaintroub [ 2023-10-27 ]

Connectivity is still broken with 8.2.0 release of MySQL Connector/NET

Comment by David Raška [ 2023-12-08 ]

Hi I just published pre-pre-alpha version of package trying to fix this issue before fix in mariadb-server will be publicly available. You can try it and let me know if it helped.

NuGet: https://www.nuget.org/packages/Jf.MySql.Data.Collations/

Sources: https://github.com/jeffraska/Jf.MySql.Data.Collations/

The package is in "works on my computer" state. This means .NET framework 4.5, really old MySql.Data 6.9.7 library and latest MariaDB 10.11.4 currently available in Debian repository. So don't expect miracles.

It uses standard Command Interceptor functionality of MySql.Data library (https://dev.mysql.com/doc/connector-net/en/connector-net-interceptors.html) to alter all `SHOW COLLATION` queries and replacing it with `SHOW COLLATION WHERE id IS NOT NULL`.

Also the package have functionality to alter MySql.Data's internal charset mapping to allow reading utf8mb3 fields in pre 8.0.28 versions of MySql.Data .

Generated at Thu Feb 08 10:25:09 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.