SHOW Statements SHOW COUNT(*) WARNINGS; SELECT @@warning_count; mysql>  CREATE TABLE t1 (a TINYINT NOT NULL, b CHAR(4)); Query OK, 0 rows affected (0.05 sec) mysql>  INSERT INTO t1 VALUES(10,’mysql’), (NULL,’test’), (300,’xyz’); Query OK, 3 rows affected, 3 warnings (0.00 sec) Records: 3 Duplicates: 0 Warnings: 3 mysql>  SHOW WARNINGS\G *************************** 1. row *************************** Level: Warning Code: 1265 Message: Data truncated for column ’b’ at row 1 *************************** 2. row *************************** Level: Warning Code: 1048 Message: Column ’a’ cannot be null *************************** 3. row *************************** Level: Warning Code: 1264 Message: Out of range value for column ’a’ at row 3 3 rows in set (0.00 sec) 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 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 Section 13.7.7.17, “SHOW ERRORS Statement” .  GET DIAGNOSTICS  can be used to examine information for individual conditions. See Section 13.6.7.3, “GET DIAGNOSTICS Statement” . Here is a simple example that shows data-conversion warnings for  INSERT . The example assumes that strict SQL mode is disabled. With strict mode enabled, the warnings would become errors and terminate the  INSERT . The  max_error_count  system variable controls the maximum number of error, warning, and note messages for which the server stores information, and thus the number of messages that  SHOW WARNINGS  displays. To change the number of messages the server can store, change the value of max_error_count . max_error_count  controls only how many messages are stored, not how many are counted. The value of  warning_count  is not limited by  max_error_count , even if the number of messages generated exceeds  max_error_count . The following example demonstrates this. The  ALTER TABLE statement produces three warning messages (strict SQL mode is disabled for the example to prevent an error from occuring after a single conversion issue). Only one message is stored and displayed because  max_error_count  has been set to 1, but all three are counted (as shown by the value of warning_count ): mysql>  SHOW VARIABLES LIKE ’max_error_count’; mysql>  SET max_error_count=1, sql_mode = ’’; Query OK, 0 rows affected (0.00 sec) +-----------------+-------+ | Variable_name | Value | +-----------------+-------+ | max_error_count | 1024 | +-----------------+-------+ 1 row in set (0.00 sec) 2967