Bug #33363 Result of concat function reporing array of bytes instead of string with
Submitted: 19 Dec 2007 10:45 Modified: 19 Dec 2007 11:55
Reporter: Jacques WERNERT Email Updates:
Status: Duplicate Impact on me:
None 
Category:Connector / ODBC Severity:S2 (Serious)
Version:3.51.22 OS:Windows
Assigned to: CPU Architecture:Any
Tags: .net, 3.51.11, 3.51.22, array of bytes, C#, concat, MyODBC

[19 Dec 2007 10:45] Jacques WERNERT
Description:
Hello,

here is my development environnement:
- Windows XP 32 / Windows 2003 64 / Windows 2000
- .NET 2 application written in C# using Mysql .NET connector
- MyODBC 3.51.11 and 3.51.22 (latest)
- MySQL Server 4 and 5 (latest stable)

Issue:
  When executing the following request from C# 
"select concat(magasinId, '.', tailleId)" where Ids are integers
  I'm getting for example "1.12" with MyODBC 3.51.11 
  and an array of bytes [ 49, 46, 49, 50 ] with MyODBC 3.51.22
  The values are the ASCII codes for the string "1.12".

I've tried differend MySQL server versions, the only way to solve this issue is to downgrade MyODBC to 3.51.11.

Note: I've tries this request under MsAccess and I'm also getting garbage with 3.51.22.

Thanks for any help

Regards 
JW

How to repeat:
select concat(1, '.', 12) with any ODBC client on Windows

with MySQL ODBC 3.51.11, the result is '1.12'
with MySQL ODBC 3.51.22, the result is ⸱㈱ (garbage)
[19 Dec 2007 10:47] Jacques WERNERT
Changed Severity as a simple request produces garbage with any ODBC client
[19 Dec 2007 11:52] Tonci Grgin
Please do not submit the same bug more than once. An existing bug report already describes this very problem. Even if you feel that your issue is somewhat different, the resolution is likely
to be the same. Because of this, we hope you add your comments to the original bug instead.

Thank you for your interest in MySQL.

Explanation: Hi Jacques and thanks for your report. Please see my last post in Bug#28365 for details:

mysql> SELECT CONCAT(1,'a') AS testfld;
Field   1:  `testfld`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  binary (63)
Length:     2
Max_length: 2
Decimals:   31
Flags:      NOT_NULL BINARY

+---------+
| testfld |
+---------+
| 1a      |
+---------+

and

mysql> SELECT CAST(CONCAT(1,'a') AS CHAR) AS testfld;
Field   1:  `testfld`
Catalog:    `def`
Database:   ``
Table:      ``
Org_table:  ``
Type:       VAR_STRING
Collation:  latin1_swedish_ci (8)
Length:     2
Max_length: 2
Decimals:   31
Flags:      NOT_NULL

+---------+
| testfld |
+---------+
| 1a      |
+---------+

This is a duplicate of Bug#28365 with similarities found in Bug#29402.
[19 Dec 2007 11:55] Jacques WERNERT
Hello,

as 3.51.11 can't handle requests to MySQL server 5.0 (unknown sql code 0)
and I don't want my "concat" bug, I've installed 3.51.12 which works for me

Regards