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
bb28bffc
Commit
bb28bffc
authored
3 years ago
by
Igor Babaev
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Ported the test case for MDEV-25682 from 10.2
No fix for this bug is needed starting from version 10.4.
parent
ddddfc33
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
41 additions
and
0 deletions
+41
-0
mysql-test/main/order_by.result
mysql-test/main/order_by.result
+25
-0
mysql-test/main/order_by.test
mysql-test/main/order_by.test
+16
-0
No files found.
mysql-test/main/order_by.result
View file @
bb28bffc
...
...
@@ -3536,6 +3536,31 @@ SET max_length_for_sort_data=@save_max_length_for_sort_data;
SET max_sort_length= @save_max_sort_length;
SET sql_select_limit= @save_sql_select_limit;
DROP TABLE t1;
#
# MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
#
create table t1 (a int);
insert into t1 values (3), (7), (1);
explain (select a from t1 limit 2) order by a desc;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using filesort
2 DERIVED t1 ALL NULL NULL NULL NULL 3
(select a from t1 limit 2) order by a desc;
a
7
3
create table t2 (a int, b int);
insert into t2 values (3,70), (7,10), (1,40), (4,30);
explain (select b,a from t2 order by a limit 3) order by b desc;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using filesort
2 DERIVED t2 ALL NULL NULL NULL NULL 4 Using filesort
(select b,a from t2 order by a limit 3) order by b desc;
b a
70 3
40 1
30 4
drop table t1,t2;
# End of 10.2 tests
#
# MDEV-16214: Incorrect plan taken by the optimizer , uses INDEX instead of ref access with ORDER BY
...
...
This diff is collapsed.
Click to expand it.
mysql-test/main/order_by.test
View file @
bb28bffc
...
...
@@ -2294,6 +2294,22 @@ SET max_sort_length= @save_max_sort_length;
SET
sql_select_limit
=
@
save_sql_select_limit
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-25682: EXPLAIN for SELECT with ORDER BY after [ORDER BY] LIMIT
--
echo
#
create
table
t1
(
a
int
);
insert
into
t1
values
(
3
),
(
7
),
(
1
);
explain
(
select
a
from
t1
limit
2
)
order
by
a
desc
;
(
select
a
from
t1
limit
2
)
order
by
a
desc
;
create
table
t2
(
a
int
,
b
int
);
insert
into
t2
values
(
3
,
70
),
(
7
,
10
),
(
1
,
40
),
(
4
,
30
);
explain
(
select
b
,
a
from
t2
order
by
a
limit
3
)
order
by
b
desc
;
(
select
b
,
a
from
t2
order
by
a
limit
3
)
order
by
b
desc
;
drop
table
t1
,
t2
;
--
echo
# End of 10.2 tests
--
echo
#
...
...
This diff is collapsed.
Click to expand it.
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