Bug #30618 command-line: table output with utf8 data mangled
Submitted: 24 Aug 2007 9:43 Modified: 24 Aug 2007 10:46
Reporter: mauritz hansen
Status: Can't repeat
Category:Client Severity:S3 (Non-critical)
Version:5.0.22 OS:Linux (Fedora 6)
Assigned to: Target Version:

[24 Aug 2007 9:43] mauritz hansen
Description:
Output of a select query that contains utf8 data is mangled. Upon building the table the
data are interpreted as bytes but displayed as characters, which causes the table
structure to be broken. Example:

mysql> select fset_id, fset_name, fset_descr, uid from filter_set;
--------------
select fset_id, fset_name, fset_descr, uid from filter_set
--------------

+---------+-----------------+--------------+-----+
| fset_id | fset_name       | fset_descr   | uid |
+---------+-----------------+--------------+-----+
|       6 | filter_all      | NULL         |   1 | 
|       7 | filter1فردو | فردو     |   2 | 
|      19 | فردوسی    | فردوسی |   1 | 
|      20 | کتاب        | کتاب     |   2 | 
|      21 | my_test_filter  | NULL         |   1 | 
+---------+-----------------+--------------+-----+
5 rows in set (0.00 sec)

How to repeat:
- create database with character set of db, table and columns set to utf8
- insert int a table utf 8 data that has characters represented by > 1 byte
- do a simple select query on the table using the command line

Suggested fix:
Upon building the table, length of data should be based on the number of characters and
not on the number of bytes.
[24 Aug 2007 10:46] Sveta Smirnova
Thank you for the report.

I can not repeat described behaviour with current version.

This should be fixed. See also bug #17939