Bug #26780 patch to add auto vertical output option to the cli.
Submitted: 2 Mar 2007 2:53 Modified: 6 Mar 2010 18:38
Reporter: Eric Bergen (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.0.33 OS:Any
Assigned to: CPU Architecture:Any
Tags: auto vertical display, Contribution

[2 Mar 2007 2:53] Eric Bergen
Description:
This patch adds --auto-vertical-output to the command client. When queries are executed with \g or ; and this option is enabled the client will switch to vertical mode if the result set is going to be wider than the terminal. \G forces vertical. 

The patch is available at http://ebergen.net/patches/auto_vertical.patch

How to repeat:
Execute a select with a result wider than the screen and watch it wrap.

Suggested fix:
Apply the patch and set the option in my.cnf :)
[29 Apr 2007 13:04] Valeriy Kravchuk
Thank you for the patch.
[12 Jun 2007 20:30] 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/28609

ChangeSet@1.2475, 2007-06-12 16:29:21-04:00, cmiller@zippy.cornsilk.net +4 -0
  Bug#26780: automatic vertical output for wide results
  
  Feature from Eric Bergen, CLA signed 2007-06-27.
  
  Adds new mysql client option "--auto-vertical-output", which causes
  the client to test whether a result table is too wide for the current
  window (where available) and emit vertical results in that case. 
  Otherwise, it sends normal tabular results.
[26 Jun 2007 20:53] Timothy Smith
Patch looks OK; minor style comment and a few additional tests requested, but no need for re-review.
[28 Jun 2007 11:55] 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/29843

ChangeSet@1.2515, 2007-06-28 07:54:33-04:00, cmiller@calliope.near.cmiller.mysql.com +4 -0
  Bug#26780: automatic vertical output for wide results
  
  Feature from Eric Bergen, CLA signed 2007-06-27.
  
  Adds new mysql client option "--auto-vertical-output", which causes
  the client to test whether a result table is too wide for the current
  window (where available) and emit vertical results in that case.
  Otherwise, it sends normal tabular results.
[4 Mar 2008 17:49] Chad MILLER
This slipped by me unnoticed somehow.  It's been in 6.0 since (probably) November.
[4 Mar 2008 19:28] Paul DuBois
The version for this feature is 6.0.4.
[17 Mar 2008 18:56] Paul DuBois
Noted in 6.0.4 changelog. Also added option description to mysql section.
[4 Nov 2009 12:20] 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/89301

2910 Magne Mahre	2009-11-04
      Bug#26780: automatic vertical output for wide results
        
      Feature from Eric Bergen, CLA signed 2007-06-27.
        
      Adds new mysql client option "--auto-vertical-output", which causes
      the client to test whether a result table is too wide for the current
      window (where available) and emit vertical results in that case.
      Otherwise, it sends normal tabular results.
     @ client/client_priv.h
        Add another enum value to client options, for automatic vertical output.
     @ client/mysql.cc
        Add another command-line option, "auto-vertical-output".
            
        Add functions to get the terminal width and functions to get the widths of fields.
            
        Use them together to emit vertical output when some output table is too wide to
        fit in the terminal.  If the terminal doesn't support reading its width, then assume
        80-positions wide.
     @ mysql-test/r/mysql.result
        Show that various select statements do work as expected.  Wide tables become vertical
        and narrow ones do not.
     @ mysql-test/t/mysql.test
        Show that various select statements do work as expected.
            
        These should be suitable for a wide range of window capabilities and sizes.  Under
        extreme circumstances, the results could be arbitrary.
[4 Nov 2009 12:21] Magne Mæhre
Backported to 5.6.0  (6.0-codebase revid: 2469.270.2)
[20 Nov 2009 12:53] Bugs System
Pushed into 5.6.0-beta (revid:davi.arnaut@sun.com-20091119234808-xbjpkwaxjt5x5c0b) (version source revid:jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf) (merge vers: 6.0.14-alpha) (pib:13)
[20 Nov 2009 12:56] Bugs System
Pushed into 6.0.14-alpha (revid:kostja@sun.com-20091120124947-yi6h2jbgw0kbciwm) (version source revid:jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf) (merge vers: 6.0.14-alpha) (pib:13)
[26 Nov 2009 15:18] Paul DuBois
Noted in 5.6.0 changelog.
[6 Mar 2010 10:51] Bugs System
Pushed into 5.5.3-m3 (revid:alik@sun.com-20100306103849-hha31z2enhh7jwt3) (version source revid:jon.hauglid@sun.com-20090928163426-2lg1gofzz44xzzxf) (merge vers: 6.0.14-alpha) (pib:16)
[6 Mar 2010 18:38] Paul DuBois
Moved 5.6.0 changelog entry to 5.5.3.