Connector/Net 5.0.5 has a problem

As many of you have already discovered, Connector/Net 5.0.5 does not work correctly with Tools for Visual Studio.  The symptom is that when the plugin tries to enumerate all the tables in the database, it reports that it gets back an improper data type.  The cause of this problem is somewhat involved so I thought I would blog on it.

Since the early days of the connector, binary data was not always handled correctly.  Specifically, columns that were reported to the connector as CHAR and VARCHAR were returned as System.String.  This is, of course, not always correct.  The case that prompted the changes was a bug report that SELECT _binary "foo" would return foo as a System.String instead of System.Byte[] as it should.

The fix is to always respect the binary markers that the server sends, which 5.0.5 does.  The problem is that MySQL incorrectly reports some columns as binary such as the name column from the output of 'SHOW TABLE STATUS'.  To work around this issue, much of my GetSchema code had to be reworked to use a datareader instead of a dataadapter.  This way I can use GetString() to get a string representation of the column even though it is binary.

All this would have been fine except I failed to test the plugin with 5.0.5 and apparently still have a case where a string column is being returned as binary.  I'm looking into it right now and we'll get a 5.0.6 out right away with this issue addressed.


Related posts

Comments

March 10. 2007 06:22 AM

Jeffrey McManus

Thanks for the post, Reggie -- this will save me some time.

Jeffrey McManus

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

July 5. 2008 03:39 AM

Search

Tags

Don't show

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008