Details
-
Bug
-
Status: Closed (View Workflow)
-
Minor
-
Resolution: Duplicate
-
None
-
None
Description
MariaDb returns some nulls as collation info.
That crashes the .Net MySql driver and Oracle os not willing to fix their driver.
–
On connect, the driver tries to load collations IDs and cast them to
integers.
However collation is nullable and there are some null-collations, for
example:
+--------------------------------+----------+------+---------+----------+---------+
|
| 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 |
|
So the driver fails to connect the database:
InvalidCast_FromDBNull: Object cannot be cast from DBNull to other
types.
Driver has the following code:
MySqlCommand mySqlCommand = new MySqlCommand("SHOW COLLATION", |
connection);
|
try |
{
|
using MySqlDataReader mySqlDataReader = |
mySqlCommand.ExecuteReader();
|
CharacterSets = new Dictionary<int, string>(); |
while (mySqlDataReader.Read()) |
{
|
CharacterSets[Convert.ToInt32(mySqlDataReader["id"], |
NumberFormatInfo.InvariantInfo)] =
|
mySqlDataReader.GetString(mySqlDataReader.GetOrdinal("charset")); |
}
|
}
|
catch (Exception ex) |
{
|
MySqlTrace.LogError(ThreadID, ex.Message);
|
throw; |
}
|
–
See e.g.: https://bugs.mysql.com/bug.php?id=109331
Attachments
Issue Links
- duplicates
-
MDEV-31608 MySQL.Data can not connect to MariaDB 11 due a collations with a NULL id.
- Closed
- is caused by
-
MDEV-27009 Add UCA-14.0.0 collations
- Closed