update is not changing internal auto increment value
Bug #314570 reported by
Aarti Pai
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Drizzle |
Fix Released
|
Critical
|
Stewart Smith | ||
Cherry |
Fix Released
|
Critical
|
Stewart Smith | ||
MariaDB |
New
|
Low
|
Unassigned | ||
MySQL Server |
Unknown
|
Unknown
|
|||
Percona-XtraDB |
Invalid
|
Undecided
|
Unassigned |
Bug Description
create table t1 (a int not null auto_increment primary key, val int);
insert into t1 (val) values (1);
update t1 set a=2 where a=1;
insert into t1 (val) values (1);
leads to:
drizzletest: At line 307: query 'insert into t1 (val) values (1)' failed: 1062: Duplicate entry '2' for key 'PRIMARY'
For InnDB this fails, for MyISAM, it passes as MyISAM updates the auto increment value.
Related branches
lp:~stewart/drizzle/bug314570
- Drizzle Developers: Pending requested
-
Diff: 137 lines (+47/-24)6 files modifiedplugin/innobase/handler/ha_innodb.cc (+34/-0)
tests/r/auto_increment.result (+3/-3)
tests/r/auto_increment_update.result (+5/-0)
tests/r/innodb.result (+0/-9)
tests/t/auto_increment_update.test (+5/-0)
tests/t/innodb.test (+0/-12)
Changed in drizzle: | |
assignee: | nobody → mordred |
milestone: | none → aloha |
Changed in drizzle: | |
assignee: | Monty Taylor (mordred) → Stewart Smith (stewart-flamingspork) |
milestone: | aloha → bell |
Changed in drizzle: | |
milestone: | bell → cherry |
Changed in drizzle: | |
status: | Confirmed → Fix Released |
status: | Fix Released → Confirmed |
Changed in drizzle: | |
milestone: | 2010-05-24 → none |
description: | updated |
Changed in drizzle: | |
status: | Confirmed → Fix Committed |
Changed in maria: | |
importance: | Undecided → Low |
Changed in drizzle: | |
status: | Fix Committed → Fix Released |
To post a comment you must log in.
Confirmed, but only for the InnoDB storage engine, which should help narrow down the fix:
jpipes@ serialcoder: ~/repos/ drizzle/ new-temporal/ tests$ ../client/drizzle --user=root --port=9306
Welcome to the Drizzle client.. Commands end with ; or \g.
Your Drizzle connection id is 1
Server version: 7.0.0 Source distribution
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
drizzle> use test
Database changed
drizzle> create table t1 (a int not null auto_increment primary key, val int)engine=innodb;
Query OK, 0 rows affected (0.01 sec)
drizzle> insert into t1 (val) values (1);
Query OK, 1 row affected (0.00 sec)
drizzle> update t1 set a=2 where a=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
drizzle> insert into t1 (val) values (1);
ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY'
drizzle> drop table t1;
Query OK, 0 rows affected (0.01 sec)
drizzle> create table t1 (a int not null auto_increment primary key, val int)engine=myisam;
Query OK, 0 rows affected (0.02 sec)
drizzle> insert into t1 (val) values (1);
Query OK, 1 row affected (0.00 sec)
drizzle> update t1 set a=2 where a=1;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1 Changed: 1 Warnings: 0
drizzle> insert into t1 (val) values (1);
Query OK, 1 row affected (0.00 sec)