Adding AUTO_INCREMENT column to a table results in data inconsistency
Bug #587170 reported by
Alex Yurchenko
This bug affects 8 people
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL patches by Codership | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
High
|
Teemu Ollakka | |||
5.6 |
Fix Released
|
High
|
Teemu Ollakka | |||
Percona XtraDB Cluster moved to https://jira.percona.com/projects/PXC | Status tracked in 5.6 | |||||
5.5 |
Fix Released
|
Undecided
|
Unassigned | |||
5.6 |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
This is because different nodes use different auto_increment_
Related branches
Changed in codership-mysql: | |
assignee: | nobody → Seppo Jaakola (seppo-jaakola) |
tags: | added: auto-inc |
Changed in codership-mysql: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Changed in codership-mysql: | |
assignee: | Seppo Jaakola (seppo-jaakola) → Vladislav Klyachin (klyachin) |
Changed in codership-mysql: | |
status: | Confirmed → Fix Committed |
To post a comment you must log in.
Here's how to reproduce:
mysql> create table t (i int);
Query OK, 0 rows affected (0.37 sec)
mysql> insert into t values (1),(2) ,(3),(4) ,(5);
Query OK, 5 rows affected (0.00 sec)
mysql> ALTER TABLE `t` ADD `id` INT NOT NULL AUTO_INCREMENT PRIMARY
KEY FIRST;Query OK, 5 rows affected (0.58 sec)
mysql> select * from t;
+----+------+
| id | i |
+----+------+
| 1 | 1 |
| 3 | 2 |
| 5 | 3 |
| 7 | 4 |
| 9 | 5 |
+----+------+
5 rows in set (0.00 sec)
Node 2:
=======
mysql> select * from t;
+----+------+
| id | i |
+----+------+
| 2 | 1 |
| 4 | 2 |
| 6 | 3 |
| 8 | 4 |
| 10 | 5 |
+----+------+
5 rows in set (0.00 sec)