Bug #76463 Log error when AUTO INCREMENT column has reached max value.
Submitted: 23 Mar 2015 17:27 Modified: 23 Mar 2015 23:04
Reporter: Van Stokes Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: Errors Severity:S3 (Non-critical)
Version:5.0/5.1/5.5/5.6/5.7 OS:Any
Assigned to: CPU Architecture:Any
Tags: auto increment

[23 Mar 2015 17:27] Van Stokes
Description:
Had a table that had an INT(11) as the 'id' (auto increment) column. It reached the maximum 2147483647. SQL INSERTS did not throw any errors to the client, nor did it error a stored procedure, nor were any errors logged to the general.log or error.log.

How to repeat:
CREATE TABLE `dk` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `a` int(11) DEFAULT NULL,
  `b` int(11) DEFAULT NULL,
  `c` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `dk_uidx01` (`a`,`b`)
) ENGINE=InnoDB AUTO_INCREMENT=2147483647 DEFAULT CHARSET=latin1
;

Suggested fix:
Throw an error to the client and log an error to the logs that the column can no longer be incremented.
[23 Mar 2015 23:04] MySQL Verification Team
Thank you for the bug report. I got the below error message in the command client but nothing printed in the log error.

mysql 5.6 > insert into dk (id) values (NULL);
ERROR 1062 (23000): Duplicate entry '2147483647' for key 'PRIMARY'
mysql 5.6 > exit
Bye
[17 Feb 2016 8:52] MySQL Verification Team
Related Bug #66566, Bug #80373