Bug #29622 mysql: Displays extra space on some result set lines
Submitted: 7 Jul 2007 22:52 Modified: 6 Aug 2009 23:36
Reporter: Paul DuBois Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.0 and up OS:Any
Assigned to: Jim Winstead CPU Architecture:Any

[7 Jul 2007 22:52] Paul DuBois
Description:
For tabular output format, the mysql client displays an extra space at the end of result set lines that display data rows. This is, in one sense, merely a cosmetic problem. However, it has a practical implication in that it does not occur in older versions, so the extra spaces make diffing output between old and new versions more difficult: The extra spaces are spurious because they cause diff to find differences that aren't "real".

How to repeat:
The problem affects MySQL 5.0 and up. It does not affect MySQL 4.1. I use cat -E to display $ at the ends of output lines.

~% /var/mysql/40124/bin/mysql -t -e 'select 1' |cat -E
+---+$
| 1 |$
+---+$
| 1 |$
+---+$
~% /var/mysql/50046/bin/mysql -t -e 'select 1' | cat -E
+---+$
| 1 |$
+---+$
| 1 | $
+---+$
~% /var/mysql/50121/bin/mysql -t -e 'select 1' | cat -E
+---+$
| 1 |$
+---+$
| 1 | $
+---+$
~% /var/mysql/50205/bin/mysql -t -e 'select 1' | cat -E
+---+$
| 1 |$
+---+$
| 1 | $
+---+$
[8 Jul 2007 0:18] MySQL Verification Team
Thank you for the bug report. Verified as described.
[21 May 2009 0:06] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/74663

2905 Jim Winstead	2009-05-20
      The mysql command-line client would include superfluous spaces at the end of
      some result set lines. (Bug #29622)
      modified:
        client/mysql.cc
        mysql-test/r/mysql.result
        mysql-test/r/parser_not_embedded.result
[14 Jul 2009 17:21] Jim Winstead
Pushed to 5.1-bugteam and mysql-pe.
[4 Aug 2009 19:50] Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090804194615-h40sa098mx4z49qg) (version source revid:jimw@mysql.com-20090714171651-ziq080rkon3u244l) (merge vers: 5.4.4-alpha) (pib:11)
[4 Aug 2009 20:45] Bugs System
Pushed into 5.1.38 (revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (version source revid:davi.arnaut@sun.com-20090804204317-ggodqkik7de6nfpz) (merge vers: 5.1.38) (pib:11)
[6 Aug 2009 23:36] Paul DuBois
Noted in 5.1.38, 5.4.4 changelogs.

mysql included extra spaces at the end of some result set lines.
[12 Aug 2009 23:00] Paul DuBois
Noted in 5.4.2 changelog because next 5.4 version will be 5.4.2 and not 5.4.4.
[15 Aug 2009 2:18] Paul DuBois
Ignore previous comment about 5.4.2.
[1 Oct 2009 5:59] Bugs System
Pushed into 5.1.39-ndb-6.3.28 (revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (version source revid:jonas@mysql.com-20091001055605-ap2kiaarr7p40mmv) (merge vers: 5.1.39-ndb-6.3.28) (pib:11)
[1 Oct 2009 7:25] Bugs System
Pushed into 5.1.39-ndb-7.0.9 (revid:jonas@mysql.com-20091001072547-kv17uu06hfjhgjay) (version source revid:jonas@mysql.com-20091001071652-irejtnumzbpsbgk2) (merge vers: 5.1.39-ndb-7.0.9) (pib:11)
[1 Oct 2009 13:25] Bugs System
Pushed into 5.1.39-ndb-7.1.0 (revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (version source revid:jonas@mysql.com-20091001123013-g9ob2tsyctpw6zs0) (merge vers: 5.1.39-ndb-7.1.0) (pib:11)
[5 Oct 2009 10:50] Bugs System
Pushed into 5.1.39-ndb-6.2.19 (revid:jonas@mysql.com-20091005103850-dwij2dojwpvf5hi6) (version source revid:jonas@mysql.com-20090930185117-bhud4ek1y0hsj1nv) (merge vers: 5.1.39-ndb-6.2.19) (pib:11)
[9 Oct 2009 1:29] Paul DuBois
The 5.4 fix has been pushed to 5.4.2.