Skip to content

Numeric Alignment Incorrect In Table Output #1102

@DCEmilberg

Description

@DCEmilberg

Hi, I just started using mycli and it is super slick. One thing that caught my eye early on is that numbers are not right aligned, compare what I see from mycli 1.22.2:

(none)> select 'left' `character`, 1 `integer`, 1.0 `double`;
+-----------+---------+--------+
| character | integer | double |
+-----------+---------+--------+
| left      | 1       | 1.0    |
+-----------+---------+--------+

With what the default mysql client shows (notice the numbers are right aligned):

mysql> select 'left' `character`, 1 `integer`, 1.0 `double`;
+-----------+---------+--------+
| character | integer | double |
+-----------+---------+--------+
| left      |       1 |    1.0 |
+-----------+---------+--------+

It's particularly jarring when there are multiple rows with different magnitudes, e.g.:

+-----------------+
| wind_speed_mean |
+-----------------+
| 5               |
| 7               |
| 9               |
| 4               |
| 4               |
| 9               |
| 9               |
| 14              |
| 12              |
| 11              |
| 15              |
| 10              |
| 8               |
| 5               |
| 8               |
| 7               |
| 6               |
| 7               |
| 7               |
| 7               |
+-----------------+

Based on screenshots I'm seeing elsewhere this is either a regression or something specific to my situation (although I'm using all defaults settings). Related issue: #635.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions