• Magne Mahre's avatar
    Bug#26780: automatic vertical output for wide results · b5d75433
    Magne Mahre authored
      
    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.
    b5d75433
mysql.cc 139 KB