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
5c8a14e9
Commit
5c8a14e9
authored
Oct 20, 2004
by
ram@gw.mysql.r18.ru
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A fix (bug #6142: SELECT DISTINCT on key field crashes server)
parent
c593ab8e
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
4 deletions
+19
-4
mysql-test/r/group_min_max.result
mysql-test/r/group_min_max.result
+6
-0
mysql-test/t/group_min_max.test
mysql-test/t/group_min_max.test
+10
-0
sql/opt_range.cc
sql/opt_range.cc
+3
-4
No files found.
mysql-test/r/group_min_max.result
View file @
5c8a14e9
...
...
@@ -1897,3 +1897,9 @@ id select_type table type possible_keys key key_len ref rows Extra
drop table t1;
drop table t2;
drop table t3;
create table t1 (
a varchar(30), b varchar(30), primary key(a), key(b)
) engine=innodb;
select distinct a from t1;
a
drop table t1;
mysql-test/t/group_min_max.test
View file @
5c8a14e9
...
...
@@ -577,3 +577,13 @@ explain select sum(ord(a1)) from t1 where (a1 > 'a') group by a1,a2,b;
drop
table
t1
;
drop
table
t2
;
drop
table
t3
;
#
# Bug #6142: a problem with the empty innodb table
#
create
table
t1
(
a
varchar
(
30
),
b
varchar
(
30
),
primary
key
(
a
),
key
(
b
)
)
engine
=
innodb
;
select
distinct
a
from
t1
;
drop
table
t1
;
sql/opt_range.cc
View file @
5c8a14e9
...
...
@@ -7040,17 +7040,16 @@ get_constant_key_infix(KEY *index_info, SEL_ARG *index_range_tree,
static
inline
uint
get_field_keypart
(
KEY
*
index
,
Field
*
field
)
{
KEY_PART_INFO
*
part
=
index
->
key_part
;
KEY_PART_INFO
*
part
,
*
end
;
uint
key_part_num
=
0
;
while
(
part
!=
part
+
index
->
key_parts
)
for
(
part
=
index
->
key_part
,
end
=
part
+
index
->
key_parts
;
part
<
end
;
part
++
)
{
key_part_num
++
;
if
(
field
->
eq
(
part
->
field
))
return
key_part_num
;
part
++
;
}
return
key_part_num
;
return
0
;
}
...
...
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