Bug #23422 verbosity and error reporting of mysql client
Submitted: 18 Oct 2006 13:50
Reporter: Shane Bester (Platinum Quality Contributor) Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:* OS:Any (*)
Assigned to: CPU Architecture:Any
Tags: verbose command line client mysql

[18 Oct 2006 13:50] Shane Bester
Description:
feature request.  'mysql -v' starts the client in a verbose mode,
but it would be nice to disable verbosity without having to
exit and reconnect to the server.

the verbose mode is useful for displaying all SQL statements executed and errors/warning they caused.  however, it would also be convenient to only show the error/warning causing statements (and not the successful ones)

How to repeat:
example:

the first few records import fine.  so, we don't care to see those sql displayed.  we only want to see the failing sql displayed.

mysql> source /tmp/wdata.sql
--------------
insert into t1(id) values(1)
--------------

Query OK, 1 row affected (0.00 sec)

--------------
insert into t1(id) values(2)
--------------

Query OK, 1 row affected (0.00 sec)

--------------
insert into t1(id) values(3)
--------------

Query OK, 1 row affected (0.00 sec)

--------------
insert into t1(id) values(3)      <--------only want to show this 
--------------

ERROR 1062 (23000): Duplicate entry '3' for key 1   <-----and this

Suggested fix:
.
[18 Oct 2006 13:50] MySQL Verification Team
hmm, i realize it would mean reordering the com_print and warnings output, since you can't know in advance if an error will happen.  would have to call com_print only if warnings/errors happened.
[2 Jul 2008 8:37] MySQL Verification Team
I guess users can implement some clever pager script to handle output better.
for example: http://www.mysqlperformanceblog.com/2008/06/23/neat-tricks-for-the-mysql-command-line-page...
but then there's the platform dependency thing..
see also bug #37793