Bug #4414 tabular result sets with multibyte utf8 characters don't align correctly
| Submitted: | 6 Jul 2004 3:31 | Modified: | 7 Jul 2004 13:57 |
|---|---|---|---|
| Reporter: | Linus Upson | Email Updates: | |
| Status: | Duplicate | Impact on me: | |
| Category: | MySQL Server: Command-line Clients | Severity: | S3 (Non-critical) |
| Version: | 4.1.3 | OS: | |
| Assigned to: | Assigned Account | CPU Architecture: | Any |
[7 Jul 2004 13:57]
Alexander Barkov
This is a duplicate bug with this one: http://bugs.mysql.com/bug.php?id=3453
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: This will be difficult to see if you aren't in a fixed pitch font, but the mysql command line client doesn't align multibyte utf8 characters correctly in tabular result sets. The code which pads out the columns appears to count bytes, not characters. The result is that the vertical bars '|' are not drawn in the correct places. How to repeat: This should be done from a utf8 terminal. set names 'utf8'; drop table if exists `t`; CREATE TABLE `t` ( `c` varchar(20) default NULL ) TYPE=MyISAM DEFAULT CHARSET=utf8; insert into `t` values ('fübar'); insert into `t` values ('fubar'); mysql-4.1.3> select LENGTH(c), CHAR_LENGTH(c), c from t; +-----------+----------------+--------+ | LENGTH(c) | CHAR_LENGTH(c) | c | +-----------+----------------+--------+ | 6 | 5 | fübar | | 5 | 5 | fubar | +-----------+----------------+--------+ Suggested fix: When computing the number of spaces to draw after the column data, characters, not bytes, should be counted.