What to do when you have too many warnings and would like to check them out.

Say you were trying to run a query which returned a heap of warnings and you want to go through the list ….

mysql> load data infile '/aaa/bbb/ccc' into table xyz LINES TERMINATED BY '\r\n';
Query OK, 0 rows affected, 65535 warnings (4 min 25.12 sec)

mysql> show warnings;
+---------+------+------------------------------------------------+
| Level   | Code | Message                                        |
+---------+------+------------------------------------------------+
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 1   |
...
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 9   |
| Warning | 1366 | Incorrect value: '' for column 'xx' at row 10  |
+---------+------+------------------------------------------------+
64 rows in set (0.00 sec)

As per above only 64 rows are show. Why?

mysql> show variables like 'max_error_count';
+-----------------+-------+
| Variable_name   | Value |
+-----------------+-------+
| max_error_count | 64    |
+-----------------+-------+
1 row in set (0.00 sec)

Ok so … what is the solution?

mysql> set max_error_count=65535;
Query OK, 0 rows affected (0.00 sec)

mysql> pager more
PAGER set to 'more'

Here I am setting the max_error_count to a high value only for the session and not globally.

Details here

The “pager more” will work only on *nix systems where the output will be “piped” to the `more` command on your OS and displayed in batches so you can pause the scrolling of the long output.

Having said the above, from my experience, when you have that many warnings, it’ll be a repetition of the same error or group of errors.

VN:F [1.9.22_1171]
Rating: 10.0/10 (1 vote cast)
VN:F [1.9.22_1171]
Rating: 0 (from 0 votes)

Show warnings with MANY MANY warnings, 10.0 out of 10 based on 1 rating

*