dbcli / mycli

A Terminal Client for MySQL with AutoCompletion and Syntax Highlighting.
http://mycli.net
Other
11.41k stars 659 forks source link

mycli chomps whitespace when printing tables. #183

Closed kojustin closed 8 years ago

kojustin commented 8 years ago

I'm trying to fix some whitespace issues in a table I am working on. There is leading whitespace in some rows, but not in others. mycli hides the difference.

This is what I see with mycli

mysql root@127.0.0.1:kiddom_teacherdashboard> SELECT DISTINCT subject from standard ORDER BY subject ASC;
+-----------------------------------------------+
| subject                                       |
|-----------------------------------------------|
|                                               |
| Science                                       |
| Science- Anatomy and Physiology of Human Body |
| Science- Ecology                              |
| Science- Entomology                           |
| Science- Environmental Physics                |
| Science- Environmental Science                |
| Science- Epidemiology                         |
| Science- Forensic Science                     |
| Science- Geology                              |
| Science- Meteorology                          |
| Science- Microbiology                         |
| Science- Oceanography                         |
| Science- Physical Science                     |
| Science- Zoology                              |
| Science-Astronomy                             |
| Science-Biology                               |
| Science-Botany                                |
| Science-Chemistry                             |
| Science-Earth Systems                         |
| Biology                                       |

In the mysql command line client

mysql> SELECT DISTINCT subject from standard ORDER BY subject ASC;
+------------------------------------------------+
| subject                                        |
+------------------------------------------------+
|                                                |
|  Science                                       |
|  Science- Anatomy and Physiology of Human Body |
|  Science- Ecology                              |
|  Science- Entomology                           |
|  Science- Environmental Physics                |
|  Science- Environmental Science                |
|  Science- Epidemiology                         |
|  Science- Forensic Science                     |
|  Science- Geology                              |
|  Science- Meteorology                          |
|  Science- Microbiology                         |
|  Science- Oceanography                         |
|  Science- Physical Science                     |
|  Science- Zoology                              |
|  Science-Astronomy                             |
|  Science-Biology                               |
|  Science-Botany                                |
|  Science-Chemistry                             |
|  Science-Earth Systems                         |
| Biology                                        |
| Calculus                                       |
| Career Readiness                               |
| Chemistry                                      |

mysql version

mysql> \status
--------------
mysql  Ver 14.14 Distrib 5.6.27, for osx10.11 (x86_64) using  EditLine wrapper

mycli installed from brew on OSX 10.11.1 (15B42).

$ mycli --version
Version: 1.4.0
amjith commented 8 years ago

Yes. We recently discovered this in our sibling project (pgcli).

I just created a fix for it in a PR (https://github.com/dbcli/mycli/pull/184).

In the meantime you can install directly from the fixed branch to try it out.

pip install -U https://github.com/dbcli/mycli/archive/amjith/remove-strip-in-tabulate.zip
kojustin commented 8 years ago

Yeah that works for me, should this issue be closed?

amjith commented 8 years ago

It is now merged into master.