Bug #7338 UNION returns wrong result from the column with a multi-byte character
Submitted: 15 Dec 2004 23:25 Modified: 15 Jun 2005 17:35
Reporter: Shuichi Tamagawa Email Updates:
Status: Closed Impact on me:
Category:MySQL Server Severity:S3 (Non-critical)
Version:5.0.3-alpha (bk Dec 13) OS:Linux (SuSE Linux 9.0)
Assigned to: Timour Katchaounov CPU Architecture:Any

[15 Dec 2004 23:25] Shuichi Tamagawa
Query using UNION returns wrong result under the following condition
- column length equals to 1
- data in the selected column has one multi-byte character
- SELECT without table reference is included in the query
  and it selects one character. (eg. SELECT 'a')

How to repeat:
Please see the attached test case file. (the file is encoded in ujis)
[15 Dec 2004 23:26] Shuichi Tamagawa
Test case

Attachment: union.test (application/octet-stream, text), 970 bytes.

[16 Dec 2004 16:31] MySQL Verification Team
I was able to repeat it only with 5.0 BK tree. Works fine with 4.1.
[20 Jan 2005 9:38] Misha Korobkov
Your MySQL connection id is 1 to server version: 4.0.18-max
mysql> (select "qwe") union (select "asds");
| qwe |
| qwe |
| asd |
2 rows in set (0.05 sec)

The second row must be ''asds"

And there at 4.1.9 version:

Your MySQL connection id is 1 to server version: 4.1.9-nt
mysql> (select "qwe") union (select "asds");
| qwe  |
| qwe  |
| asds |
2 rows in set (0.05 sec) 
There all ok
[21 Feb 2005 11:53] MySQL Verification Team
Shuichi, can you test it with latest 5.0? Because I can't repeat it with latest 5.0 bk tree.
[22 Mar 2005 0: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".
[15 Jun 2005 17:35] Shuichi Tamagawa

Sorry for the late reply.
I confirmed that it works fine on 5.0.6-beta.