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
202ea81c
Commit
202ea81c
authored
Mar 26, 2004
by
unknown
Browse files
Options
Browse Files
Download
Plain Diff
Merge bk-internal.mysql.com:/home/bk/mysql-4.0
into mysql.com:/home/my/mysql-4.0
parents
8a6ae839
cc11f6f3
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
1 deletion
+43
-1
myisam/mi_create.c
myisam/mi_create.c
+7
-1
mysql-test/r/myisam.result
mysql-test/r/myisam.result
+22
-0
mysql-test/t/myisam.test
mysql-test/t/myisam.test
+14
-0
No files found.
myisam/mi_create.c
View file @
202ea81c
...
...
@@ -366,7 +366,13 @@ int mi_create(const char *name,uint keys,MI_KEYDEF *keydefs,
my_errno
=
HA_WRONG_CREATE_OPTION
;
goto
err
;
}
if
((
keydef
->
flag
&
(
HA_NOSAME
|
HA_NULL_PART_KEY
))
==
HA_NOSAME
)
/*
key_segs may be 0 in the case when we only want to be able to
add on row into the table. This can happen with some DISTINCT queries
in MySQL
*/
if
((
keydef
->
flag
&
(
HA_NOSAME
|
HA_NULL_PART_KEY
))
==
HA_NOSAME
&&
key_segs
)
share
.
state
.
rec_per_key_part
[
key_segs
-
1
]
=
1L
;
length
+=
key_length
;
keydef
->
block_length
=
MI_BLOCK_SIZE
(
length
,
pointer
,
MI_MAX_KEYPTR_SIZE
);
...
...
mysql-test/r/myisam.result
View file @
202ea81c
...
...
@@ -431,3 +431,25 @@ a concat(b,'.')
1 a.
3 a .
drop table t1;
create table t1 (a int not null);
create table t2 (a int not null, primary key (a));
insert into t1 values (1);
insert into t2 values (1),(2);
select sql_big_result distinct t1.a from t1,t2 order by t2.a;
a
1
select distinct t1.a from t1,t2 order by t2.a;
a
1
select sql_big_result distinct t1.a from t1,t2;
a
1
explain select sql_big_result distinct t1.a from t1,t2 order by t2.a;
table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
explain select distinct t1.a from t1,t2 order by t2.a;
table type possible_keys key key_len ref rows Extra
t1 system NULL NULL NULL NULL 1 Using temporary
t2 index NULL PRIMARY 4 NULL 2 Using index; Distinct
drop table t1,t2;
mysql-test/t/myisam.test
View file @
202ea81c
...
...
@@ -422,3 +422,17 @@ update t1 set b='b ' where a > 1;
delete
from
t1
where
b
=
'b'
;
select
a
,
concat
(
b
,
'.'
)
from
t1
;
drop
table
t1
;
#
# Test keys with 0 segments. (Bug #3203)
#
create
table
t1
(
a
int
not
null
);
create
table
t2
(
a
int
not
null
,
primary
key
(
a
));
insert
into
t1
values
(
1
);
insert
into
t2
values
(
1
),(
2
);
select
sql_big_result
distinct
t1
.
a
from
t1
,
t2
order
by
t2
.
a
;
select
distinct
t1
.
a
from
t1
,
t2
order
by
t2
.
a
;
select
sql_big_result
distinct
t1
.
a
from
t1
,
t2
;
explain
select
sql_big_result
distinct
t1
.
a
from
t1
,
t2
order
by
t2
.
a
;
explain
select
distinct
t1
.
a
from
t1
,
t2
order
by
t2
.
a
;
drop
table
t1
,
t2
;
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