Bug #71232 Wrong behaviour for auto_increment unsigned bigint column approaching max value
| Submitted: | 26 Dec 2013 11:34 | Modified: | 4 Jul 2014 9:51 |
|---|---|---|---|
| Reporter: | Valeriy Kravchuk | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
| Version: | 5.6.15 | OS: | Any |
| Assigned to: | CPU Architecture: | Any |
[26 Dec 2013 11:34]
Valeriy Kravchuk
[4 Jul 2014 9:50]
MySQL Verification Team
Hello Valeriy,
Thank you for the report.
Verified as described.
//
mysql> select version();
+-------------------------------------------+
| version() |
+-------------------------------------------+
| 5.6.20-enterprise-commercial-advanced-log |
+-------------------------------------------+
1 row in set (0.00 sec)
mysql> create table ai (id bigint unsigned auto_increment primary key, c1 int) engine=InnoDB;
Query OK, 0 rows affected (0.34 sec)
mysql> insert into ai values(18446744073709551613, 1) on duplicate key update c1
-> =c1+1;
Query OK, 1 row affected (0.03 sec)
mysql> select * from ai;
+----------------------+------+
| id | c1 |
+----------------------+------+
| 18446744073709551613 | 1 |
+----------------------+------+
1 row in set (0.00 sec)
mysql> insert into ai values(NULL, 1) on duplicate key update c1=c1+1;
Query OK, 1 row affected (0.04 sec)
mysql> select * from ai;
+----------------------+------+
| id | c1 |
+----------------------+------+
| 18446744073709551613 | 1 |
| 18446744073709551614 | 1 |
+----------------------+------+
2 rows in set (0.00 sec)
mysql>
mysql> insert into ai values(NULL, 1) on duplicate key update c1=c1+1;
ERROR 1467 (HY000): Failed to read auto-increment value from storage engine
mysql> insert into ai values(18446744073709551615, 1) on duplicate key update c1
-> =c1+1;
Query OK, 1 row affected (0.06 sec)
mysql> select * from ai;
+----------------------+------+
| id | c1 |
+----------------------+------+
| 18446744073709551613 | 1 |
| 18446744073709551614 | 1 |
| 18446744073709551615 | 1 |
+----------------------+------+
3 rows in set (0.00 sec)
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.051 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.