branches/zip: innodb-index.test: Test duplicate key failures for different

indexes.
This commit is contained in:
marko 2008-01-04 15:25:59 +00:00
parent 051ee49116
commit 7e62ee83c7
2 changed files with 5 additions and 5 deletions

View file

@ -627,10 +627,10 @@ t1 CREATE TABLE `t1` (
) ENGINE=InnoDB DEFAULT CHARSET=latin1
drop table t1;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe');
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
alter table t1 add unique index (b), add unique index (c), add unique index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
alter table t1 add unique index (b), add index (d), add unique index (c);
ERROR 23000: Duplicate entry '4' for key 'b'
alter table t1 add unique index (c), add unique index (b), add index (d);
ERROR 23000: Duplicate entry 'ac' for key 'c'
show create table t1;
Table Create Table

View file

@ -181,11 +181,11 @@ show create table t1;
drop table t1;
create table t1(a int not null, b int, c char(10), d varchar(20), primary key (a)) engine = innodb;
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe');
insert into t1 values (1,1,'ab','ab'),(2,2,'ac','ac'),(3,3,'ac','ac'),(4,4,'afe','afe'),(5,4,'affe','affe');
--error ER_DUP_ENTRY
alter table t1 add unique index (b), add unique index (c), add unique index (d);
--error ER_DUP_ENTRY
alter table t1 add unique index (b), add index (d), add unique index (c);
alter table t1 add unique index (c), add unique index (b), add index (d);
show create table t1;
drop table t1;