Show Create Table outputs System.Byte[] not string 64bit Server

Developer
May 9, 2014 at 7:52 AM
hi adrian
i just want you to know that i found a bug using mysqlback, when i backup our database from one of our servers: Mysql Server 5.0.41 community-nt. The show create table query outputs System.Byte[] instead of string, so my solution is to check first if the object that the datarow returns is a string object or Byte[] object.
  if (dt.Rows[0][columnIndex] is System.Byte[])
            {
                return Encoding.UTF8.GetString((System.Byte[])dt.Rows[0][columnIndex], 0, ((System.Byte[])dt.Rows[0][columnIndex]).Length);
            }
            else 
            {
                return dt.Rows[0][columnIndex].ToString();
            }
Coordinator
May 9, 2014 at 9:57 AM
Edited May 11, 2014 at 1:55 PM
I have received a few reports telling me that SHOW CREATE TABLE will return byte[].
But never I could reproduce the error.

Now, I finally get some useful information which tells the cause of the problem. It is not an error, it is default behavior of old MySQL server.

I have just downloaded MySQL server version of 5.0.41 from archives of MySQL (http://downloads.mysql.com/archives/community/) and test executing SHOW CREATE TABLE query. Yes, it returns byte[].

Your solution is right.

We shall update the codes.
Thanks for the info
Coordinator
May 11, 2014 at 8:33 AM
New version is released.
Downloadable via codeplex.com or NuGet.