mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
Fix reporting of type for unique key on VARCHAR field. (Bug #11227)
mysql-test/r/key.result: Add new results mysql-test/t/key.test: Add new regression test sql/table.cc: Use keyinfo->key_parts to determine if key is part of a multiple-field key or is unique.
This commit is contained in:
@@ -354,3 +354,28 @@ t1 CREATE TABLE `t1` (
|
||||
KEY `a` (`a`,`b`)
|
||||
) ENGINE=MyISAM DEFAULT CHARSET=latin1
|
||||
drop table t1;
|
||||
create table t1 (a int not null primary key, b varchar(20) not null unique);
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI
|
||||
b varchar(20) NO UNI
|
||||
drop table t1;
|
||||
create table t1 (a int not null primary key, b int not null unique);
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI
|
||||
b int(11) NO UNI
|
||||
drop table t1;
|
||||
create table t1 (a int not null primary key, b varchar(20) not null, unique (b(10)));
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI
|
||||
b varchar(20) NO UNI
|
||||
drop table t1;
|
||||
create table t1 (a int not null primary key, b varchar(20) not null, c varchar(20) not null, unique(b(10),c(10)));
|
||||
desc t1;
|
||||
Field Type Null Key Default Extra
|
||||
a int(11) NO PRI
|
||||
b varchar(20) NO MUL
|
||||
c varchar(20) NO
|
||||
drop table t1;
|
||||
|
Reference in New Issue
Block a user