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.