1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Check for duplicate index (port from mysql)

(pre fts)
This commit is contained in:
unknown
2013-09-20 22:30:19 +03:00
parent c9f0792c29
commit 192bafe526
25 changed files with 418 additions and 14 deletions

View File

@@ -404,6 +404,8 @@ user_id name phone ref_email detail
drop table t1;
CREATE TABLE t1 (a int not null, b int not null,c int not null,
key(a),primary key(a,b), unique(c),key(a),unique(b));
Warnings:
Note 1831 Duplicate index 'a_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
show index from t1;
Table Non_unique Key_name Seq_in_index Column_name Collation Cardinality Sub_part Packed Null Index_type Comment Index_comment
t1 0 PRIMARY 1 a A # NULL NULL BTREE
@@ -1442,6 +1444,8 @@ t2 CREATE TABLE `t2` (
CONSTRAINT `t1_id_fk` FOREIGN KEY (`id`) REFERENCES `t1` (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1
create index id2 on t2 (id);
Warnings:
Note 1831 Duplicate index 'id2' defined on the table 'test.t2'. This is deprecated and will be disallowed in a future release.
show create table t2;
Table Create Table
t2 CREATE TABLE `t2` (
@@ -1850,6 +1854,8 @@ id select_type table type possible_keys key key_len ref rows Extra
alter table t1 add unique(v);
ERROR 23000: Duplicate entry '{ ' for key 'v_2'
alter table t1 add key(v);
Warnings:
Note 1831 Duplicate index 'v_2' defined on the table 'test.t1'. This is deprecated and will be disallowed in a future release.
select concat('*',v,'*',c,'*',t,'*') as qq from t1 where v='a';
qq
*a*a*a*