Bug #77279 Use unicode to draw borders (contribution)
Submitted: 9 Jun 2015 11:47 Modified: 17 Jul 2015 12:14
Reporter: OCA Admin (OCA) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version: OS:Any
Assigned to: Georgi Kodinov CPU Architecture:Any

[9 Jun 2015 11:47] OCA Admin
Description:
This bug tracks a contribution by Daniël van Eeden (Github user: dveeden) as described in http://github.com/mysql/mysql-server/pull/11

How to repeat:
See description

Suggested fix:
See contribution code attached
[9 Jun 2015 11:47] OCA Admin
Contribution submitted via Github - Use unicode to draw borders 
(*) Contribution by Daniël van Eeden (Github dveeden, mysql-server/pull/11#issuecomment-110116447): I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: git_patch_37114095.txt (text/plain), 3.92 KiB.

[9 Jun 2015 15:16] Sinisa Milivojevic
Thank you for your contribution.

I see exactly what it does, but I would like to ask for the justification. Why are you multiplying all lengths by 3 ???

In the near future, we might have utf8mb4 as a default character set, so then we shall need to multiply by 4. 

Have you noticed any irregularities when displaying result set output containing UTF8 strings. If so, can you provide an example ???
[10 Jun 2015 11:14] Daniël van Eeden
I believe the horizontal separator I chose is 3 bytes long, so that is why I multiply by 3.

I did not see any irregularities. But I only tested with gnome-terminal on Linux.
[10 Jun 2015 14:23] Sinisa Milivojevic
Actually, your contribution has truly opened a path to a full unicode separators for borders used to be drawn when presenting result sets.

Your patch is on the good path, but it requires improvements. You are using '+'  on the top and bottom rows. Instead you should use 'T' and inverted 'T'. 

To put it simple, we will accept your patch if there are no hanging lines outside the rectangle, just as I described above. Last, you should make this type of Unicode display optional, so that everything will work just as it does now, on non-utf-8-terminals !!

Thanks in advance.
[11 Jul 2015 1:00] Bugs System
No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
[11 Jul 2015 17:07] Daniël van Eeden
Updated patch

Attachment: mysql_unicode_drawing_v2.patch (text/x-patch), 6.98 KiB.

[11 Jul 2015 17:07] Daniël van Eeden
Updated patch

(*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.

Contribution: mysql_unicode_drawing_v2.patch (text/x-patch), 6.98 KiB.

[11 Jul 2015 17:08] Daniël van Eeden
Related: Bug #58478
[13 Jul 2015 10:39] Daniël van Eeden
This is how it looks currently:

mysql> DESC mysql.func;
┌───────┬──────────────────────────────┬──────┬─────┬─────────┬───────┐
│ Field │ Type                         │ Null │ Key │ Default │ Extra │
├───────┼──────────────────────────────┼──────┼─────┼─────────┼───────┤
│ name  │ char(64)                     │ NO   │ PRI │         │       │
│ ret   │ tinyint(1)                   │ NO   │     │ 0       │       │
│ dl    │ char(128)                    │ NO   │     │         │       │
│ type  │ enum('function','aggregate') │ NO   │     │ NULL    │       │
└───────┴──────────────────────────────┴──────┴─────┴─────────┴───────┘
4 rows in set (0.00 sec)
[13 Jul 2015 10:43] Daniël van Eeden
To have it displayed w/o gaps on bugs.mysql.com the line-height for pre.note has to be set to max 14px.

pre.note {
    line-height: 14px;
}
[17 Jul 2015 12:14] Georgi Kodinov
Thank you for your feature request and your contribution. Moving to verified.
[23 Jul 2015 16:41] Daniël van Eeden
Alternatively we could use rounded corners… but I don't think we should.

mysql> DESC mysql.func;
╭───────┬──────────────────────────────┬──────┬─────┬─────────┬───────╮
│ Field │ Type                         │ Null │ Key │ Default │ Extra │
├───────┼──────────────────────────────┼──────┼─────┼─────────┼───────┤
│ name  │ char(64)                     │ NO   │ PRI │         │       │
│ ret   │ tinyint(1)                   │ NO   │     │ 0       │       │
│ dl    │ char(128)                    │ NO   │     │         │       │
│ type  │ enum('function','aggregate') │ NO   │     │ NULL    │       │
╰───────┴──────────────────────────────┴──────┴─────┴─────────┴───────╯
4 rows in set (0.00 sec)
[23 Jul 2015 17:12] Sinisa Milivojevic
I agree .. no rounder corner.