Bug #40449 [mysql.exe] Add an option to add/remove the padding space in the output table

Submitted: 31 Oct 2008 4:29 Modified: 27 May 2012 9:17
Reporter: Liu Yan Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.1 OS:Any
Assigned to: CPU Architecture:Any
Tags: padding, reduce, space, width

[31 Oct 2008 4:29] Liu Yan
Description:
When many columns are selected, the total padding spaces added in each column will make the width of each line too long to display, it will be displayed as 2+ lines in DOS window. If padding spaces are removed, it will reduce the width of output line.

Example:
[code]
-- With padding spaces
+--------+----------+---------+-------------------+---------------------+-------+---------------------+---------------------+----+------+----+
| server | callid   | ani     | dnis              | begin               | alert | conct               | end                 | 通 | 长   | 挂 |
+--------+----------+---------+-------------------+---------------------+-------+---------------------+---------------------+----+------+----+
| 3.6    | 14787496 | 2196877 | 702165921035      | 2008-10-30 15:54:36 | NULL  | NULL                | 0000-00-00 00:00:00 |    |    0 |  0 |
| 3.6    | 14787495 | 2196877 | *018702165921035  | 2008-10-30 15:54:36 | NULL  | 2008-10-30 15:54:36 | 0000-00-00 00:00:00 |   |    0 |  0 |
+--------+----------+---------+-------------------+---------------------+-------+---------------------+---------------------+----+------+----+

-- Without padding spaces
+------+--------+-------+-----------------+-------------------+-----+-------------------+-------------------+--+----+--+
|server|callid  |ani    |dnis             |begin              |alert|conct              |end                |通|长  |挂|
+------+--------+-------+-----------------+-------------------+-----+-------------------+-------------------+--+----+--+
|3.6   |14787496|2196877|702165921035     |2008-10-30 15:54:36|NULL |NULL               |0000-00-00 00:00:00|  |   0| 0|
|3.6   |14787495|2196877|*018702165921035 |2008-10-30 15:54:36|NULL |2008-10-30 15:54:36|0000-00-00 00:00:00| |   0| 0|
+------+--------+-------+-----------------+-------------------+-----+-------------------+-------------------+--+----+--+

[/code]

How to repeat:
issue a SELECT command in mysql.exe, such as:
select now(), now(), now(), now(), now(), now(), now(), now()

Suggested fix:
add an option to add/remove the padding space

if default behaviour of mysql.exe is WITH_PADDING_SPACE, then add a --remove-padding-spaces option

if default behaviour of mysql.exe is WITHOUT_PADDING_SPACE, then add a --add-padding-spaces option
[27 May 2012 9:17] Valeriy Kravchuk
Thank you for the feature request.

Portions of this website are copyright © 2001, 2002 The PHP Group

Page generated in 0.049 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.