Bug #38980 CONCAT returns wrong result with UTF-8
Submitted: 23 Aug 2008 6:03 Modified: 26 May 2010 6:12
Reporter: Alexandra Champavert Email Updates:
Status: No Feedback Impact on me:
None 
Category:MySQL Server: Charsets Severity:S3 (Non-critical)
Version:5.0.51b-community-nt OS:Windows (Vista SP1)
Assigned to: CPU Architecture:Any
Tags: concat, UTF-8

[23 Aug 2008 6:03] Alexandra Champavert
Description:
When concatening strings in UTF-8 with the functions CONCAT or CONCAT_WS, the result returned is not strictly UTF-8.

How to repeat:
SELECT ...., CONCAT(A1," ",B1," ") FROM C1

Database created in UTF-8,
Server is in utf8_general_ci collation
All tables created with utf8_general_ci collation
All string fields in tables created with utf8_general_ci collation

Suggested fix:
No suggestion. It's, I suppose, in the source code of this function
[23 Aug 2008 7:05] Valeriy Kravchuk
Thank you for a problem report. Please, try to repeat with a newer version, 5.0.67. In case of the same problem, please, send a complete test case and the results of:

show variables like 'char%';
[23 Sep 2008 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[16 Dec 2009 3:19] Samphan Raruenrom
We've tried the function on MySQL 5.0.67 with UTF-8 data (in Thai, 3 bytes per code point). It still doesn't work.
[23 Apr 2010 20:03] John Baxter
This bug still present.  Very simple to reproduce.  Just have a table with 2 columns ,firstname, lastname.  Enter   José Doe,  Now do a concat on firstname, lastname.  You will get invalid characters.  I am using 5.0.84
[26 Apr 2010 6:12] Valeriy Kravchuk
Still, I need to see the results of:

show session variables like 'char%';

from the environment where you have the problem.
[26 May 2010 23:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".