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
1241d867
Commit
1241d867
authored
Jun 15, 2006
by
igor@rurik.mysql.com
Browse files
Options
Browse Files
Download
Plain Diff
Merge rurik.mysql.com:/home/igor/mysql-4.1-opt
into rurik.mysql.com:/home/igor/mysql-5.0-opt
parents
9b7ecb55
5cdd1eb6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
26 additions
and
2 deletions
+26
-2
mysql-test/r/func_group.result
mysql-test/r/func_group.result
+13
-0
mysql-test/t/func_group.test
mysql-test/t/func_group.test
+9
-0
sql/opt_sum.cc
sql/opt_sum.cc
+4
-2
No files found.
mysql-test/r/func_group.result
View file @
1241d867
...
...
@@ -845,6 +845,19 @@ EXPLAIN SELECT MAX(b) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 2
DROP TABLE t1;
CREATE TABLE t1 (id int , b varchar(512), INDEX(b(250))) COLLATE latin1_bin;
Warnings:
Warning 1246 Converting column 'b' from CHAR to TEXT
INSERT INTO t1 VALUES
(1,CONCAT(REPEAT('_', 250), "qq")), (1,CONCAT(REPEAT('_', 250), "zz")),
(1,CONCAT(REPEAT('_', 250), "aa")), (1,CONCAT(REPEAT('_', 250), "ff"));
SELECT MAX(b) FROM t1;
MAX(b)
__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________zz
EXPLAIN SELECT MAX(b) FROM t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 4
DROP TABLE t1;
create table t2 (ff double);
insert into t2 values (2.2);
select cast(sum(distinct ff) as decimal(5,2)) from t2;
...
...
mysql-test/t/func_group.test
View file @
1241d867
...
...
@@ -558,6 +558,15 @@ SELECT MAX(b) FROM t1;
EXPLAIN
SELECT
MAX
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
CREATE
TABLE
t1
(
id
int
,
b
varchar
(
512
),
INDEX
(
b
(
250
)))
COLLATE
latin1_bin
;
INSERT
INTO
t1
VALUES
(
1
,
CONCAT
(
REPEAT
(
'_'
,
250
),
"qq"
)),
(
1
,
CONCAT
(
REPEAT
(
'_'
,
250
),
"zz"
)),
(
1
,
CONCAT
(
REPEAT
(
'_'
,
250
),
"aa"
)),
(
1
,
CONCAT
(
REPEAT
(
'_'
,
250
),
"ff"
));
SELECT
MAX
(
b
)
FROM
t1
;
EXPLAIN
SELECT
MAX
(
b
)
FROM
t1
;
DROP
TABLE
t1
;
# End of 4.1 tests
#
...
...
sql/opt_sum.cc
View file @
1241d867
...
...
@@ -710,8 +710,10 @@ static bool find_key_for_maxmin(bool max_fl, TABLE_REF *ref,
if
(
!
(
table
->
file
->
index_flags
(
idx
,
jdx
,
0
)
&
HA_READ_ORDER
))
return
0
;
/* Check whether the index component is partial */
if
(
part
->
length
<
table
->
field
[
part
->
fieldnr
-
1
]
->
pack_length
())
/* Check whether the index component is partial */
Field
*
part_field
=
table
->
field
[
part
->
fieldnr
-
1
];
if
((
part_field
->
flags
&
BLOB_FLAG
)
||
part
->
length
<
part_field
->
key_length
())
break
;
if
(
field
->
eq
(
part
->
field
))
...
...
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