Bug #89514 MySQL Shell does not provide tab format in batch mode
Submitted: 2 Feb 2018 22:16 Modified: 4 Jul 2018 12:13
Reporter: Efrain Cordero Lopez Email Updates:
Status: Closed Impact on me:
None 
Category:Shell General / Core Client Severity:S3 (Non-critical)
Version:1.0.11 OS:Windows
Assigned to: CPU Architecture:Any

[2 Feb 2018 22:16] Efrain Cordero Lopez
Description:
I know that MySQL Shell is a recently added utility, but the bug report page does not include a "MySQL Shell" category. For that reason I report the bug in "MySQL Server" general category.

The problem was the next: I executed a SELECT sql query in batch mode in MySQL Shell tool (with --file option). Acording to MySQL 5.7 Reference Manual, section 18.3.3.2, "tab separated format is used by default when running MySQL Shell in batch mode". I expect the output were in that format. The real output was in table format, and there is no way to get it in tab separated format.

How to repeat:
a) Create a text file (test.sql) with a line with the following text:

SELECT 1, 2, 3 FROM dual;

b) Invoke MySQL Shell:

mysqlsh <args to connect to a database> --sql --file=test.sql >> output.txt

The result will be the next:

.
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+
| 1 | 2 | 3 |
+---+---+---+

Suggested fix:
Juts fix it to accomplish the documented functionality. It will be very useful to have a "silent" option in both interactive and batch mode (like in MySQL console).
[14 Feb 2018 13:18] MySQL Verification Team
Hello Efrain,

Thank you for the report.

Thanks,
Umesh
[4 Jul 2018 12:13] Margaret Fisher
Posted by developer:
 
Changelog entry added for MySQL 8.0.13:
When running MySQL Shell in batch mode, tab separated format is the default for output. In some situations, table format was used for output instead. This issue has now been fixed. A command line option --tabbed has also been added to switch to the tab separated format for output when MySQL Shell is in interactive mode, where the default is table format.

Documentation for --tabbed option added to
https://dev.mysql.com/doc/mysql-shell/8.0/en/mysql-shell-output-tab-format.html
https://dev.mysql.com/doc/mysql-shell/8.0/en/mysqlsh-command.html