Bug #78199 CONCAT() with CASE in derived table returns unexpected results
Submitted: 25 Aug 2015 6:25 Modified: 17 Feb 2021 14:24
Reporter: Yu Asano Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Parser Severity:S3 (Non-critical)
Version:5.6.26,5.5.25,5.5.20 OS:Any
Assigned to: CPU Architecture:Any
Tags: case, concat, derived table

[25 Aug 2015 6:25] Yu Asano
Description:
The query:
SELECT * FROM (SELECT CONCAT( CASE 1 WHEN 1 THEN 1 END, '}}' ) as a) as b;

Expected result:
+------+
| a    |
+------+
| 1}}  |
+------+

Actual Result:
+------+
| a    |
+------+
| 1}   |
+------+

How to repeat:
See description.

Suggested fix:
Correct the query result as expected one.
[25 Aug 2015 7:22] MySQL Verification Team
Hello Yu Asano,

Thank you for the report and test case.
Verified as described on 5.6.26.

Thanks,
Umesh
[17 Feb 2021 14:24] Erlend Dahl
Not reproducible on 5.7/8.0. 5.5 and 5.6 are EOL.