Commit 2adf2fad authored by sasha@mysql.sashanet.com's avatar sasha@mysql.sashanet.com
Browse files

test case for InnoDB replace/auto_increment bug when insert_id is

forced by the user
parent b938f5a7
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -475,3 +475,7 @@ a
1
2
4
id	name	value	uid
1	one	one value	101
3	three	three value	103
6	two	other value	102
+22 −0
Original line number Diff line number Diff line
@@ -490,3 +490,25 @@ delete from t1 where a=3;
insert into t1 values (NULL);
select * from t1;
drop table t1;

#Slashdot bug
create table t1
 (
  id int auto_increment primary key,
  name varchar(32) not null,
  value text not null,
  uid int not null,
  unique key(name,uid)
 ) type=innodb;
insert into t1 values (1,'one','one value',101),
 (2,'two','two value',102),(3,'three','three value',103);
set insert_id=5;
replace into t1 (value,name,uid) values ('other value','two',102);
delete from t1 where uid=102;
set insert_id=5;
replace into t1 (value,name,uid) values ('other value','two',102);
set insert_id=6;
replace into t1 (value,name,uid) values ('other value','two',102);
select * from t1;
drop table t1;