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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
a3deb945
Commit
a3deb945
authored
18 years ago
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Plain Diff
Merge epotemkin@bk-internal.mysql.com:/home/bk/mysql-5.1
into moonbone.local:/work/merge-5.1
parents
79ebe922
1459784a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
31 additions
and
1 deletion
+31
-1
mysql-test/r/key.result
mysql-test/r/key.result
+9
-1
mysql-test/t/key.test
mysql-test/t/key.test
+1
-0
sql/table.cc
sql/table.cc
+21
-0
No files found.
mysql-test/r/key.result
View file @
a3deb945
...
@@ -336,8 +336,16 @@ UNIQUE i1idx (i1),
...
@@ -336,8 +336,16 @@ UNIQUE i1idx (i1),
UNIQUE i2idx (i2));
UNIQUE i2idx (i2));
desc t1;
desc t1;
Field Type Null Key Default Extra
Field Type Null Key Default Extra
i1 int(11) NO
UN
I
i1 int(11) NO
PR
I
i2 int(11) NO UNI
i2 int(11) NO UNI
show create table t1;
Table Create Table
t1 CREATE TABLE `t1` (
`i1` int(11) NOT NULL,
`i2` int(11) NOT NULL,
UNIQUE KEY `i1idx` (`i1`),
UNIQUE KEY `i2idx` (`i2`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1
drop table t1;
drop table t1;
create table t1 (
create table t1 (
c1 int,
c1 int,
...
...
This diff is collapsed.
Click to expand it.
mysql-test/t/key.test
View file @
a3deb945
...
@@ -334,6 +334,7 @@ create table t1 (
...
@@ -334,6 +334,7 @@ create table t1 (
UNIQUE
i1idx
(
i1
),
UNIQUE
i1idx
(
i1
),
UNIQUE
i2idx
(
i2
));
UNIQUE
i2idx
(
i2
));
desc
t1
;
desc
t1
;
show
create
table
t1
;
drop
table
t1
;
drop
table
t1
;
#
#
...
...
This diff is collapsed.
Click to expand it.
sql/table.cc
View file @
a3deb945
...
@@ -1025,6 +1025,27 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
...
@@ -1025,6 +1025,27 @@ static int open_binary_frm(THD *thd, TABLE_SHARE *share, uchar *head,
if
(
share
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
if
(
share
->
key_info
[
key
].
flags
&
HA_FULLTEXT
)
share
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
share
->
key_info
[
key
].
algorithm
=
HA_KEY_ALG_FULLTEXT
;
if
(
primary_key
>=
MAX_KEY
&&
(
keyinfo
->
flags
&
HA_NOSAME
))
{
/*
If the UNIQUE key doesn't have NULL columns and is not a part key
declare this as a primary key.
*/
primary_key
=
key
;
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
i
++
)
{
uint
fieldnr
=
key_part
[
i
].
fieldnr
;
if
(
!
fieldnr
||
share
->
field
[
fieldnr
-
1
]
->
null_ptr
||
share
->
field
[
fieldnr
-
1
]
->
key_length
()
!=
key_part
[
i
].
length
)
{
primary_key
=
MAX_KEY
;
// Can't be used
break
;
}
}
}
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
key_part
++
,
i
++
)
for
(
i
=
0
;
i
<
keyinfo
->
key_parts
;
key_part
++
,
i
++
)
{
{
Field
*
field
;
Field
*
field
;
...
...
This diff is collapsed.
Click to expand it.
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