Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
mariadb
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
d6d1a9aa
Commit
d6d1a9aa
authored
Jul 22, 2005
by
jimw@mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge mysql.com:/home/jimw/my/mysql-5.0-11227
into mysql.com:/home/jimw/my/mysql-5.0-clean
parents
421f267b
1d19a4e7
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
4 deletions
+44
-4
mysql-test/r/key.result
mysql-test/r/key.result
+25
-0
mysql-test/t/key.test
mysql-test/t/key.test
+16
-0
sql/table.cc
sql/table.cc
+3
-4
No files found.
mysql-test/r/key.result
View file @
d6d1a9aa
...
...
@@ -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;
mysql-test/t/key.test
View file @
d6d1a9aa
...
...
@@ -337,3 +337,19 @@ show create table t1;
alter
table
t1
modify
a
varchar
(
20
);
show
create
table
t1
;
drop
table
t1
;
#
# Bug #11227: Incorrectly reporting 'MUL' vs. 'UNI' on varchar
#
create
table
t1
(
a
int
not
null
primary
key
,
b
varchar
(
20
)
not
null
unique
);
desc
t1
;
drop
table
t1
;
create
table
t1
(
a
int
not
null
primary
key
,
b
int
not
null
unique
);
desc
t1
;
drop
table
t1
;
create
table
t1
(
a
int
not
null
primary
key
,
b
varchar
(
20
)
not
null
,
unique
(
b
(
10
)));
desc
t1
;
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
;
drop
table
t1
;
sql/table.cc
View file @
d6d1a9aa
...
...
@@ -702,10 +702,9 @@ int openfrm(THD *thd, const char *name, const char *alias, uint db_stat,
key_part
->
key_part_flag
|=
HA_BIT_PART
;
if
(
i
==
0
&&
key
!=
primary_key
)
field
->
flags
|=
((
keyinfo
->
flags
&
HA_NOSAME
)
&&
field
->
key_length
()
==
keyinfo
->
key_length
?
UNIQUE_KEY_FLAG
:
MULTIPLE_KEY_FLAG
);
field
->
flags
|=
((
keyinfo
->
flags
&
HA_NOSAME
)
&&
(
keyinfo
->
key_parts
==
1
))
?
UNIQUE_KEY_FLAG
:
MULTIPLE_KEY_FLAG
;
if
(
i
==
0
)
field
->
key_start
.
set_bit
(
key
);
if
(
field
->
key_length
()
==
key_part
->
length
&&
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment