Documentation Home
MySQL Connector/NET Developer Guide
Related Documentation Download this Manual
PDF (US Ltr) - 1.3Mb
PDF (A4) - 1.3Mb

MySQL Connector/NET Developer Guide  /  Connector/NET Programming  /  Binary and Nonbinary Issues

5.15 Binary and Nonbinary Issues

There are certain situations where MySQL will return incorrect metadata about one or more columns. More specifically, the server can sometimes report that a column is binary when it is not (and the reverse). In these situations, it becomes practically impossible for the connector to be able to correctly identify the correct metadata.

Some examples of situations that may return incorrect metadata are:

  • Execution of SHOW PROCESSLIST. Some of the columns are returned as binary even though they only hold string data.

  • When a temporary table is used to process a result set, some columns may be returned with incorrect binary flags.

  • Some server functions such DATE_FORMAT return the column incorrectly as binary.

With the availability of BINARY and VARBINARY data types, it is important to respect the metadata returned by the server. However, some existing applications may encounter issues with this change and can use a connection string option to enable or disable it. By default, Connector/NET respects the binary flags returned by the server. You might need to make small changes to your application to accommodate this change.

In the event that the changes required to your application are too large, adding 'respect binary flags=false' to your connection string causes the connector to use the prior behavior: any column that is marked as string, regardless of binary flags, will be returned as string. Only columns that are specifically marked as a BLOB will be returned as BLOB.