Old bug from 2011 re-appears in latest dotConnect for MySQL

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for MySQL
Post Reply
FransBouma
Posts: 29
Joined: Fri 25 Nov 2005 10:43

Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by FransBouma » Mon 22 Oct 2018 10:55

Hi,

(.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]);
				}
			}
		}
	}
}
gives: (The 'System.Byte[]' is the ToString() on the value (so it returns its type) as the value has to be a string, but that's not the case).
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

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by Pinturiccio » Wed 24 Oct 2018 15:26

We have reproduced the issue. We will investigate it and post here about the results as soon as possible.

FransBouma
Posts: 29
Joined: Fri 25 Nov 2005 10:43

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by FransBouma » Wed 07 Nov 2018 11:02

Any news on this? It's been a while and we can't proceed with testing.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by Pinturiccio » Mon 12 Nov 2018 16:17

We have fixed the bug with the MySqlConnection.GetSchema("Procedures",...) method returning an incorrect type of the "Comment" column in the metadata table for MySQL 8.0. We will post here when the corresponding build of dotConnect for MySQL is available for download.

FransBouma
Posts: 29
Joined: Fri 25 Nov 2005 10:43

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by FransBouma » Mon 12 Nov 2018 16:50

Thanks, but I can also reproduce it with a DESCRIBE query (see repro above), so the bug is elsewhere too, not only in the Procedures schema retrieval.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by Pinturiccio » Mon 12 Nov 2018 17:03

It is fixed in a describe query as well.

FransBouma
Posts: 29
Joined: Fri 25 Nov 2005 10:43

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by FransBouma » Mon 12 Nov 2018 17:18

Thanks :)

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: Old bug from 2011 re-appears in latest dotConnect for MySQL

Post by Pinturiccio » Thu 29 Nov 2018 13:46

New build of dotConnect for MySQL 8.12.1278 is available for download now!
It can be downloaded from http://www.devart.com/dotconnect/mysql/download.html (trial version) or from Customer Portal (for users with valid subscription only).
For more information, please refer to viewtopic.php?t=38122

Post Reply