1create table bug51378 (
2col1 int not null,
3col2 blob not null,
4col3 time not null) engine = innodb;
5create unique index idx on bug51378(col1, col2(31));
6alter table bug51378 add unique index idx2(col1, col2(31));
7Warnings:
8Warning	1831	Duplicate index 'idx2' defined on the table 'test.bug51378'. This is deprecated and will be disallowed in a future release.
9create unique index idx3 on bug51378(col1, col3);
10SHOW CREATE TABLE bug51378;
11Table	Create Table
12bug51378	CREATE TABLE `bug51378` (
13  `col1` int(11) NOT NULL,
14  `col2` blob NOT NULL,
15  `col3` time NOT NULL,
16  UNIQUE KEY `idx3` (`col1`,`col3`),
17  UNIQUE KEY `idx` (`col1`,`col2`(31)),
18  UNIQUE KEY `idx2` (`col1`,`col2`(31))
19) ENGINE=InnoDB DEFAULT CHARSET=latin1
20drop index idx3 on bug51378;
21SHOW CREATE TABLE bug51378;
22Table	Create Table
23bug51378	CREATE TABLE `bug51378` (
24  `col1` int(11) NOT NULL,
25  `col2` blob NOT NULL,
26  `col3` time NOT NULL,
27  UNIQUE KEY `idx` (`col1`,`col2`(31)),
28  UNIQUE KEY `idx2` (`col1`,`col2`(31))
29) ENGINE=InnoDB DEFAULT CHARSET=latin1
30alter table bug51378 add primary key idx3(col1, col2(31));
31SHOW CREATE TABLE bug51378;
32Table	Create Table
33bug51378	CREATE TABLE `bug51378` (
34  `col1` int(11) NOT NULL,
35  `col2` blob NOT NULL,
36  `col3` time NOT NULL,
37  PRIMARY KEY (`col1`,`col2`(31)),
38  UNIQUE KEY `idx` (`col1`,`col2`(31)),
39  UNIQUE KEY `idx2` (`col1`,`col2`(31))
40) ENGINE=InnoDB DEFAULT CHARSET=latin1
41drop table bug51378;
42create table bug51378 (
43col1 int not null,
44col2 blob not null,
45col3 time not null, primary key(col1, col2(31))) engine = innodb;
46create unique index idx on bug51378(col1, col2(31));
47SHOW CREATE TABLE bug51378;
48Table	Create Table
49bug51378	CREATE TABLE `bug51378` (
50  `col1` int(11) NOT NULL,
51  `col2` blob NOT NULL,
52  `col3` time NOT NULL,
53  PRIMARY KEY (`col1`,`col2`(31)),
54  UNIQUE KEY `idx` (`col1`,`col2`(31))
55) ENGINE=InnoDB DEFAULT CHARSET=latin1
56drop table bug51378;
57create table bug51378 (
58col1 int not null,
59col2 int ) engine = innodb;
60create unique index idx on bug51378(col1, col2);
61SHOW CREATE TABLE bug51378;
62Table	Create Table
63bug51378	CREATE TABLE `bug51378` (
64  `col1` int(11) NOT NULL,
65  `col2` int(11) DEFAULT NULL,
66  UNIQUE KEY `idx` (`col1`,`col2`)
67) ENGINE=InnoDB DEFAULT CHARSET=latin1
68drop table bug51378;
69