Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.6.0, 10.6.1, 10.6.2, 10.6.3, 10.6.4
-
None
-
Current MySql Connector (8.0.26)
Description
I am using C# (.NET 5.0) and ADO.NET to execute statements on MariaDb. For this, I am using the MySql connector (current version: 8.0.26) to run statements on the database.
I am trying to execute the following statement to create a table that has a primary key. The primary key has a constraint name.
string sql = $@"CREATE TABLE `test` (
`id` INT NOT NULL
, CONSTRAINT `pk1` PRIMARY KEY (`id`)
)";
MySqlCommand cmd = new MySqlCommand(sql, conn);
cmd.ExecuteNonQuery();
Though the table is created, this code throws an exception with MariaDb 10.6.4:
System.NotSupportedException: 'Character set 'utf8mb3' is not supported by .Net Framework.'
It worked fine on MariaDb 10.5.12. When I create named unique and foreign key constraints I don't get an exception.
I am guessing it is related to the switch to utf8mb4 as default collation introduced with 10.6.
See attached file for the full example code in C#.
Attachments
Issue Links
- is caused by
-
MDEV-8334 Rename utf8 to utf8mb3
- Closed
- relates to
-
MDEV-26607 Information schema not accessable in C# using MySql connector
- Open
-
MDEV-26105 MariaDB 10.6 cannot be used from C# client applications
- Closed