Syntax:
SHOW WARNINGS [LIMIT [offset,] row_count]
SHOW COUNT(*) WARNINGS

SHOW WARNINGS is a diagnostic statement that displays information about
the conditions (errors, warnings, and notes) resulting from executing a
statement in the current session. Warnings are generated for DML
statements such as INSERT, UPDATE, and LOAD DATA INFILE as well as DDL
statements such as CREATE TABLE and ALTER TABLE.

The LIMIT clause has the same syntax as for the SELECT statement. See
http://dev.mysql.com/doc/refman/5.7/en/select.html.

SHOW WARNINGS is also used following EXPLAIN EXTENDED, to display the
extra information generated by EXPLAIN when the EXTENDED keyword is
used. See http://dev.mysql.com/doc/refman/5.7/en/explain-extended.html.

As of MySQL 5.7.2, SHOW WARNINGS displays information about the
conditions resulting from execution of the most recent nondiagnostic
statement in the current session. If the most recent statement resulted
in an error during parsing, SHOW WARNINGS shows the resulting
conditions, regardless of statement type (diagnostic or nondiagnostic).

Before MySQL 5.7.2, SHOW WARNINGS displays information about the
conditions resulting from the most recent statement in the current
session that generated messages. It shows nothing if the most recent
statement used a table and generated no messages. (That is, statements
that use a table but generate no messages clear the message list.)
Statements that do not use tables and do not generate messages have no
effect on the message list.

The SHOW COUNT(*) WARNINGS diagnostic statement displays the total
number of errors, warnings, and notes. You can also retrieve this
number from the warning_count system variable:

SHOW COUNT(*) WARNINGS;
SELECT @@warning_count;

A difference in these statements is that the first is a diagnostic
statement that does not clear the message list. The second, because it
is a SELECT statement is considered nondiagnostic and, as of MySQL
5.7.2, does clear the message list.

A related diagnostic statement, SHOW ERRORS, shows only error
conditions (it excludes warnings and notes), and SHOW COUNT(*) ERRORS
statement displays the total number of errors. See [HELP SHOW ERRORS].
GET DIAGNOSTICS can be used to examine information for individual
conditions. See [HELP GET DIAGNOSTICS].

URL: http://dev.mysql.com/doc/refman/5.7/en/show-warnings.html

