(.NET full, 4.7.1, windows 8.1 x64, mysql: latest, dotconnect for mysql: latest, express edition. MySQL db uses defaults when installed and v5.x connection scheme. Examples used are the v8.x sakila db)
I'm the lead dev of LLBLGen Pro and we use DevArt's dotConnect for MySQL to support MySQL. Back in 2011 you had a bug (see ticket nr. 34339, or a thread on our support forums: https://www.llblgen.com/TinyForum/Messa ... adID=20412) where the 'Comment' column in the 'Procedures' schema view returned by DbConnection.GetSchema("Procedures"..) has an empty array (byte[0]) instead of NULL/DBNull.Value when the value is null.
This bug is now reappearing with the latest dotConnect for MySQL (v8) the express version, using latest MySQL build, on the Sakila database.
As you correct it before in 2011, I assume this is a bug in your ADO.NET connector. We can of course introduce a workaround but I think it's best if this was fixed where it actually goes wrong, as the column is supposed to contain a string (or null), not a byte array.
TIA
(edit) The problem also occurs when fetching a simple resultset using a DbDataAdapter in a datatable, e.g. DESCRIBE `actor` gives a byte[] array for 'Type' while it should be a string. However, I've enabled 'Unicode=true;' in the connection string (or charset=utf8mb4;), but that doesn't have any effect it seems... Assembly used is:
Devart.Data.MySql, Version=8.12.1229.0, Culture=neutral, PublicKeyToken=09af7300eec23701
Using the connector on a mysql 5.6 DB (also sakila), works fine. So it's related to mysql 8 and the latest connector. Same code is used on both mysql dbs so that can't be it.
Small repro:
Code: Select all
using System;
using System.Data;
using System.Data.Common;
using Devart.Data.MySql;
namespace mysqltester
{
internal class Program
{
public static void Main(string[] args)
{
using(var con = new MySqlConnection("Server=YOURSERVERHERE;Port=3308;Database=Sakila;User ID=root;Password=YOURROOTPWHERE;Unicode=true;"))
{
con.Open();
Console.WriteLine("Assembly: {0}", con.GetType().AssemblyQualifiedName);
var results = new DataTable();
var adapter = new MySqlDataAdapter("DESCRIBE `actor`", con);
adapter.Fill(results);
for(int i=0;i<results.Rows.Count;i++)
{
var r = results.Rows[i];
Console.WriteLine("Field: {0}. Type: {1}", r[0], r[1]);
}
}
}
}
}
Assembly: Devart.Data.MySql.MySqlConnection, Devart.Data.MySql, Version=8.12.122
9.0, Culture=neutral, PublicKeyToken=09af7300eec23701
Field: actor_id. Type: System.Byte[]
Field: first_name. Type: System.Byte[]
Field: last_name. Type: System.Byte[]
Field: last_update. Type: System.Byte[]
Expected (running DESCRIBE `actor` in Mysql workbench 8)
actor_id smallint(5) unsigned
first_name varchar(45)
last_name varchar(45)
last_update timestamp