Details
-
Bug
-
Status: Closed (View Workflow)
-
Critical
-
Resolution: Fixed
-
10.2.12, 10.3.3
-
SLES 12
Description
Using MariaDB 10.2.12, there is a change in behaviour compared to, e.g. 10.1.22 when changing a value of an AUTO_INCREMENT-column to a negative value: the AUTO_INCREMENT increases to the maximum possible number and subsequent inserts fail.
In 10.1.22, the same sequence succeeds.
MariaDB [test]> select version(); |
+---------------------+ |
| version() |
|
+---------------------+ |
| 10.2.12-MariaDB-log |
|
+---------------------+ |
1 row in set (0,00 sec) |
MariaDB [test]> create table animals (`id` mediumint(9) NOT NULL AUTO_INCREMENT, `name` char(30) NOT NULL, PRIMARY KEY (`id`)); |
Query OK, 0 rows affected (0,01 sec) |
|
MariaDB [test]> insert into animals (name) values ("dog"); |
Query OK, 1 row affected (0,00 sec)
|
|
MariaDB [test]> select * from animals; |
+----+------+ |
| id | name | |
+----+------+ |
| 1 | dog |
|
+----+------+ |
1 row in set (0,00 sec) |
MariaDB [test]> update animals set id=-1 where id=1; |
Query OK, 1 row affected (0,00 sec)
|
Rows matched: 1 Changed: 1 Warnings: 0 |
|
MariaDB [test]> select * from animals; |
+----+------+ |
| id | name | |
+----+------+ |
| -1 | dog |
|
+----+------+ |
1 row in set (0,00 sec) |
|
MariaDB [test]> insert into animals (name) values ("cat"); |
ERROR 1467 (HY000): Failed to read auto-increment value from storage engine
MariaDB [test]> show create table animals; |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| Table | Create Table | |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
| animals | CREATE TABLE `animals` ( |
`id` mediumint(9) NOT NULL AUTO_INCREMENT, |
`name` char(30) NOT NULL, |
PRIMARY KEY (`id`) |
) ENGINE=InnoDB {color:red}AUTO_INCREMENT=18446744073709551615{color} DEFAULT CHARSET=utf8 | |
+---------+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+ |
1 row in set (0,00 sec) |
Attachments
Issue Links
- is caused by
-
MDEV-14008 Assertion failing: `!is_set() || (m_status == DA_OK_BULK && is_bulk_op())
- Closed
- relates to
-
MDEV-16534 PPC64: Unexpected error with a negative value into auto-increment columns in HEAP, MyISAM, ARIA
- Closed
-
MDEV-16652 heap.heap_auto_increment, main.auto_increment fail, maria.maria-autoinc in buildbot with out-of-range error
- Closed