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
2479f3cb
Commit
2479f3cb
authored
Apr 18, 2012
by
Chaithra Gopalareddy
Browse files
Options
Browse Files
Download
Plain Diff
Merge from 5.1 to 5.5
parents
30b2e005
81058259
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
59 additions
and
2 deletions
+59
-2
mysql-test/r/select.result
mysql-test/r/select.result
+27
-0
mysql-test/t/select.test
mysql-test/t/select.test
+32
-0
sql/sql_select.cc
sql/sql_select.cc
+0
-2
No files found.
mysql-test/r/select.result
View file @
2479f3cb
...
...
@@ -4988,3 +4988,30 @@ f1
DROP TABLE t1;
DROP VIEW view_t1;
# End of test BUG#63020
#
# Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY
# COUNT(*) LIMIT.
#
CREATE TABLE t1 (
id BIGINT(20) ,
member_id_to INT(11) ,
r_date DATE ,
PRIMARY KEY (id,r_date),
KEY r_date_idx (r_date),
KEY t1_idx01 (member_id_to)
) ENGINE=InnoDB;
INSERT INTO t1 VALUES
(107924526,518491,'2011-05-01'),
(107924527,518491,'2011-05-01'),
(107924534,518491,'2011-06-21'),
(107924535,518491,'2011-06-21'),
(107924542,1601319,'2011-06-21'),
(107924543,1601319,'2011-06-21'),
(107924544,1601319,'2011-06-21'),
(107924545,1601319,'2011-06-21');
SELECT member_id_to, COUNT(*) FROM t1 WHERE r_date =
'2011-06-21' GROUP BY member_id_to ORDER BY 2 LIMIT 1;
member_id_to COUNT(*)
518491 2
DROP TABLE t1;
# End of test BUG#12713907
mysql-test/t/select.test
View file @
2479f3cb
...
...
@@ -4253,3 +4253,35 @@ DROP VIEW view_t1;
--
echo
# End of test BUG#63020
--
echo
#
--
echo
# Bug#12713907: STRANGE OPTIMIZE & WRONG RESULT UNDER ORDER BY
--
echo
# COUNT(*) LIMIT.
--
echo
#
CREATE
TABLE
t1
(
id
BIGINT
(
20
)
,
member_id_to
INT
(
11
)
,
r_date
DATE
,
PRIMARY
KEY
(
id
,
r_date
),
KEY
r_date_idx
(
r_date
),
KEY
t1_idx01
(
member_id_to
)
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
107924526
,
518491
,
'2011-05-01'
),
(
107924527
,
518491
,
'2011-05-01'
),
(
107924534
,
518491
,
'2011-06-21'
),
(
107924535
,
518491
,
'2011-06-21'
),
(
107924542
,
1601319
,
'2011-06-21'
),
(
107924543
,
1601319
,
'2011-06-21'
),
(
107924544
,
1601319
,
'2011-06-21'
),
(
107924545
,
1601319
,
'2011-06-21'
);
SELECT
member_id_to
,
COUNT
(
*
)
FROM
t1
WHERE
r_date
=
'2011-06-21'
GROUP
BY
member_id_to
ORDER
BY
2
LIMIT
1
;
DROP
TABLE
t1
;
--
echo
# End of test BUG#12713907
sql/sql_select.cc
View file @
2479f3cb
...
...
@@ -13925,8 +13925,6 @@ check_reverse_order:
join_read_first:
join_read_last
;
tab
->
type
=
JT_NEXT
;
// Read with index_first(), index_next()
if
(
table
->
covering_keys
.
is_set
(
best_key
))
table
->
set_keyread
(
TRUE
);
table
->
file
->
ha_index_or_rnd_end
();
if
(
tab
->
join
->
select_options
&
SELECT_DESCRIBE
)
{
...
...
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