Bug #27221 describe SQL command returns all byte array on MySQL versions older than 4.1.7
Submitted: 16 Mar 2007 17:23 Modified: 8 May 2007 16:41
Reporter: Robert Hood Email Updates:
Status: Closed Impact on me:
None 
Category:Connector / NET Severity:S3 (Non-critical)
Version:5.0.7, server 4.1.3 OS:Windows (Win XP)
Assigned to: CPU Architecture:Any

[16 Mar 2007 17:23] Robert Hood
Description:
When executing a "DESCRIBE ..." SQL Command with MySqlCommand returns a data table full of byte arrays instead of the actual results when connecting to a MySQL server that is version 4.1.15 or older.  The connection string we are using is formatted in the following format:

DataSource=xxxxxxx;uid=xxxxxx;pwd=xxxxxx;database=xxxxxx;Convert Zero Datetime=True;Allow Batch=FALSE

How to repeat:
Connect to a MySql server that is older than 4.1.15, create a MySqlCommand object, and execute a SQL command in the formate "DESCRIBE `database`.`table`;"  Then use the Visual Studio 2005 DataTable visualizer to view the contents of the returned table.
[20 Mar 2007 16:57] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/22389
[20 Mar 2007 18:06] Reggie Burnett
Fixed in 5.0.6
[26 Mar 2007 6:25] MC Brown
A note has been added to the 5.0.6 changelog.
[26 Mar 2007 19:30] Robert Hood
Fixed verified for at least MySql Versions 4.1.7 and later.  However, the bug remains for version 4.1.1-alpha.  If all you're doing is checking the server version you're connecting to before making your query, can you just treat versions 4.1.0 and later the same as 4.1.7 and later?
[2 Apr 2007 11:35] Tonci Grgin
Verified with test case at the bottom on:
 - MySQL server 4.1.3 running on remote computer
 - c/NET SVN sources, rev 651
 - NET fw 2.0
 - Both client and host computers run on WinXP Pro SP2

--<cut>--
============================
Field = System.Byte[]
Type = System.Byte[]
Null = System.Byte[]
Key = System.Byte[]
Default = System.Byte[]
Extra = System.Byte[]
============================
--<cut>--

Changing the synopsis.

Test case:
  private static void DisplayData(System.Data.DataTable table)
  {
      foreach (System.Data.DataRow row in table.Rows)
      {
          foreach (System.Data.DataColumn col in table.Columns)
          {
              Console.WriteLine("{0} = {1}", col.ColumnName, row[col]);
          }
          Console.WriteLine("============================");
      }
  }
  private void bnBug27221_Click(object sender, EventArgs e)
  {
      MySqlConnection conn = new MySqlConnection();
      conn.ConnectionString = DataaSource=10.192.192.8;Database=mysql;UserID=root;Password=;PORT=3306";
      conn.Open();
      MySqlDataAdapter da = new MySqlDataAdapter("DESCRIBE mysql.user", conn);
      DataTable dt = new DataTable();
      da.Fill(dt);
      DisplayData(dt);
      Console.WriteLine("Done.");
      dt.Clear();
      da.Dispose();
      conn.Close();
  }
[8 May 2007 16:41] Reggie Burnett
Robert

4.1.7 was the first production version of MySQL 4.1.  We make a commitment to make sure our products work with all production versions of MySQL and the latest pre-release version of products that have not yet gone GA.  I apologize for the inconvenience but I cannot support pre-GA products once a GA version is released.

Reggie