Bug #14040 Error when using .Net connector with MySQL 4.1.14
Submitted: 14 Oct 2005 21:16 Modified: 17 Oct 2005 14:06
Reporter: Bob Dankert Email Updates:
Status: Closed Impact on me:
Category:Connector / NET Severity:S1 (Critical)
Version:1.0.6 OS:Windows (Win XP SP2)
Assigned to: CPU Architecture:Any

[14 Oct 2005 21:16] Bob Dankert
When I query "show tables" in MySQL 4.1.14 using MySQL .Net Connector 1.0.6 (also tried 1.0.3), I get an error (see below).  When I use change my server with duplicate data but running MySQL 4.1.13a, I do not get the error.  The error is:

An unspecified error occured.
System.InvalidCastException: Specified cast is not valid.
   at System.Convert.ToInt64(Object value)
   at MySql.Data.MySqlClient.NativeDriver.Configure(MySqlConnection connection)
   at MySql.Data.MySqlClient.MySqlConnection.Open()
   at MyDBTools.DBExecute.executeMySqlQuery(DBConnect connection, String DBSQL)
show tables;

I've noticed that the error is on MySQLConnection open (if a connection is not open before a query, I open the connection), so I am not sure if this is specifically related to the query or to opening a connection with the database.  The data in both databases is identical, all MyISAM tables with the data files all copied from one to the other.  My connection string is:  	
ConnectionString	"Database=wcasa;Host=;User Id=root;Password=;Connect Timeout=15;Pooling=false;"	string

How to repeat:
Query "show tables;" from MySQL 4.1.14, or possibly just try to open a connection?
[16 Oct 2005 7:46] Vasily Kishkin
Sorry....I was not able to reproduce the bug using MySQL 4.1.15 and 1.0.6 connector. Could you please re-test it on MySQL 4.1.15 ? My test case is attached.
[16 Oct 2005 7:46] Vasily Kishkin
Test case

Attachment: 14040.zip (application/x-zip-compressed, text), 5.60 KiB.

[17 Oct 2005 13:15] Bob Dankert
Where does one get 4.1.15?  I only see the GA 4.1.14...

It was suggested this could be related to a Convert.ToInt64 call to parse the variable max_allowed_packet, but the value for this on my server is 1048576, which is the default and should not cause issue.  

Ironically, this issue no longer giving the error anymore today.  It seems as though whatever was causing this on Friday has now passed.  The MySQL database installation was fresh, as well as the .Net connector (probably both without a reboot), so I do not know if that is related to the matter.
[17 Oct 2005 13:23] Bob Dankert
It is too early on a Monday morning, I should not have said that the problem has gone away...  My software was still set to use the 4.1.13 server and not the 4.1.14 server.  I will try to debug the Connector to see precisely where this problem is coming from and post the results if I find them.  Also, I tried the test case and that did work fine, so I am not sure what is going on.
[17 Oct 2005 14:06] Bob Dankert
After compiling the .net connector from the source and using this DLL as opposed to the pre-compiled DLL, I no longer have the problem.  Not sure really what caused the original issue.