Bug #43525 No warning thrown on 'Out of range' with auto-increment field
Submitted: 10 Mar 2009 4:04 Modified: 10 Mar 2009 21:09
Reporter: Nidhi Shrotriya Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S3 (Non-critical)
Version:5.1.33, 6.0.11 OS:Any
Assigned to: Assigned Account CPU Architecture:Any

[10 Mar 2009 4:04] Nidhi Shrotriya
Description:
See How to Repeat section.

How to repeat:
CREATE TABLE t5(c1 TINYINT UNSIGNED NOT NULL AUTO_INCREMENT, c2 TINYINT SIGNED NULL, c3 TINYINT SIGNED NOT NULL, c4 SMALLINT, c5 MEDIUMINT, c6 INT, c7 INTEGER, c8 BIGINT, PRIMARY KEY(c1,c2), UNIQUE INDEX(c3))engine=innodb;
INSERT INTO t5 VALUES(255,127,6,7,8,9,10,10);
INSERT INTO t5(c2,c3) VALUES(33,34) /* tries to increment out of range */;

Other Engines(MyISAM, Maria, Falcon)
Warnings:
Warning 1264    Out of range value for column 'c1' at row 1
SELECT * FROM t5;
255     127     6       7       8       9       10      10
255     33      34      NULL    NULL    NULL    NULL    NULL

Innodb:
No warning
SELECT * FROM t5;
255     127     6       7       8       9       10      10
255     33      34      NULL    NULL    NULL    NULL    NULL
[10 Mar 2009 5:15] Valeriy Kravchuk
Thank you for the bug report. Verified just as described, also - with 5.1.33.

On 5.1.33 with sql_mode='STRICT_ALL_TABLES' I've also got an assertion failure:

090310  7:11:49  InnoDB: Assertion failure in thread 2955325440 in file handler/ha_innodb.cc line 7654
InnoDB: Failing assertion: prebuilt->autoinc_last_value >= *first_value
[10 Mar 2009 21:09] Sunny Bains
Duplicate of Bug#43203. Fix sent in snapshot innodb-5.1-ss4350.tar.gz on 4 Mar 2009.