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
afa8187f
Commit
afa8187f
authored
Sep 19, 2005
by
evgen@moonbone.local
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix bug #13218: InnoDB: using a partial-field key prefix in search
This is backport from 5.0 of fix for bug #11039
parent
15bf8f6a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
20 additions
and
1 deletion
+20
-1
mysql-test/r/innodb.result
mysql-test/r/innodb.result
+9
-0
mysql-test/t/innodb.test
mysql-test/t/innodb.test
+9
-0
sql/opt_sum.cc
sql/opt_sum.cc
+2
-1
No files found.
mysql-test/r/innodb.result
View file @
afa8187f
...
...
@@ -1685,3 +1685,12 @@ explain select * from t1 order by a,b,c,d;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using filesort
drop table t1;
create table t1 (a char(1), b char(1), key(a, b)) engine=innodb;
insert into t1 values ('8', '6'), ('4', '7');
select min(a) from t1;
min(a)
4
select min(b) from t1 where a='8';
min(b)
6
drop table t1;
mysql-test/t/innodb.test
View file @
afa8187f
...
...
@@ -1230,4 +1230,13 @@ select * from t1 order by a,b,c,d;
explain
select
*
from
t1
order
by
a
,
b
,
c
,
d
;
drop
table
t1
;
#
# BUG#11039,#13218 Wrong key length in min()
#
create
table
t1
(
a
char
(
1
),
b
char
(
1
),
key
(
a
,
b
))
engine
=
innodb
;
insert
into
t1
values
(
'8'
,
'6'
),
(
'4'
,
'7'
);
select
min
(
a
)
from
t1
;
select
min
(
b
)
from
t1
where
a
=
'8'
;
drop
table
t1
;
# End of 4.1 tests
sql/opt_sum.cc
View file @
afa8187f
...
...
@@ -661,7 +661,8 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
If key_part2 may be NULL, then we want to find the first row
that is not null
*/
ref
->
key_buff
[
ref
->
key_length
++
]
=
1
;
ref
->
key_buff
[
ref
->
key_length
]
=
1
;
ref
->
key_length
+=
part
->
store_length
;
*
range_fl
&=
~
NO_MIN_RANGE
;
*
range_fl
|=
NEAR_MIN
;
// > NULL
}
...
...
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