mirror of
https://github.com/MariaDB/server.git
synced 2025-01-22 14:54:20 +01:00
branches/zip: innodb-index.test: Test duplicate key failures for different
indexes.
This commit is contained in:
parent
051ee49116
commit
7e62ee83c7
2 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue