Bug #34912 | Execute VB.NET T-SQL Case When...End, result is returned as Byte.Array | ||
---|---|---|---|
Submitted: | 27 Feb 2008 22:29 | Modified: | 1 Mar 2008 0:02 |
Reporter: | Antonis B. | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | Connector / NET | Severity: | S1 (Critical) |
Version: | 5.1.2 | OS: | Windows (XP SP2) |
Assigned to: | CPU Architecture: | Any | |
Tags: | Byte.Array, Connector/Net, T-SQL Case When...End |
[27 Feb 2008 22:29]
Antonis B.
[29 Feb 2008 15:58]
Reggie Burnett
Antonis I assembed a test case pretty close to what you are reporting and what you are seeing is the new binary respect that is in 5.1. You can run your query from the mysql command line using the 5.1 client and give the --column-type-info command line parameter to see what I am talking about. Since your case statement can return multiple types of data then mysqld is returning it as binary. Here is a paste of that column from my test: Field 2: `field_value` Catalog: `def` Database: `` Table: `` Org_table: `` Type: VAR_STRING Collation: binary (63) Length: 65535 Max_length: 1 Decimals: 31 Flags: BINARY +------+-------------+ | id | field_value | +------+-------------+ we determine whether a field is binary by the collation and the flags. They are both set to binary in this example which means by default this column will be returned as VAR_BINARY. You have three options. Rewrite your query to return a single data table that is not binary, use a data reader and the .GetSTring() method will will convert the binary value to a string, or set the new connection string option 'Respect Binary Flags' to false which more or less reproduces the old 5.0 behavior. | 1 | 1 | +------+-------------+
[1 Mar 2008 0:02]
Antonis B.
Mr. Burnett, Thanks for your replay, your specifications was help me very much. I was suspecting that but, i was confused by the old version 5.0 different behavior, than the newer. My Best Regards, Antonis B.