Bug #37793 mysql cli verbosity level at stdin error
Submitted: 2 Jul 2008 8:26
Reporter: Johan Idrén Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S4 (Feature request)
Version:5.0,5.1,6.0 OS:Any
Assigned to: CPU Architecture:Any

[2 Jul 2008 8:26] Johan Idrén
Description:
mysql cli client accepts stdin as file input

shell> mysql < data.sql

however if there is an error in data.sql you only get to see rownumber and error

shell> mysql -uroot test < data.sql 
ERROR 1136 (21S01) at line 1: Column count doesn't match value count at row 15

using verbose mode (-v) you get to see all commands run

shell> mysql -uroot -v test < lol.sql 
--------------
insert into t values(1)
--------------
...
--------------
insert into t values(1)
--------------

--------------
insert into t values(1,3)
--------------

ERROR 1136 (21S01) at line 15: Column count doesn't match value count at row 1

There should be an option to print the sql statement that produced the error, somewhere between the current default behavior and -v

How to repeat:
Contained in description

Suggested fix:
shell> mysql -uroot --print-error-statements test < data.sql
ERROR 1136 (21S01) at line 15: Column count doesn't match value count at row 1
Statement at line 15: insert into t values(1,3)