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
4b8e54bb
Commit
4b8e54bb
authored
Apr 17, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-7885, MDEV-8857: Add testcases
The issues themselves were fixed as part of MDEV-8646
parent
9664240c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
64 additions
and
0 deletions
+64
-0
mysql-test/r/order_by_optimizer.result
mysql-test/r/order_by_optimizer.result
+30
-0
mysql-test/t/order_by_optimizer.test
mysql-test/t/order_by_optimizer.test
+34
-0
No files found.
mysql-test/r/order_by_optimizer.result
0 → 100644
View file @
4b8e54bb
drop table if exists t0,t1,t2,t3;
#
# MDEV-7885: EXPLAIN shows wrong info for ORDER BY query
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1(a int);
insert into t1 select A.a + B.a* 10 + C.a * 100 from t0 A, t0 B, t0 C;
create table t2 (key1 int, col1 int, key(key1));
insert into t2 select a,a from t0;
insert into t2 select 15,15 from t1;
alter table t2 add key2 int, add key(key2);
# This must show "Using filesort":
explain
select * from t2 ignore index for order by (key1) where col1<0 order by key1 limit 10;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t2 ALL NULL NULL NULL NULL 1010 Using where; Using filesort
drop table t0, t1, t2;
#
# MDEV-8857: [Upstream too] EXPLAIN incorrectly shows Distinct for tables using join buffer
#
create table t0(a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, filler char(200), key(a));
insert into t1 select A.a + B.a* 10, 'AAAAAAAAAAAAAAAAAAAA' from t0 A, t0 B where B.a in (0,1);
explain select distinct A.a from t0 A, t1 B where A.a+B.a> 0;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE A ALL NULL NULL NULL NULL 10 Using temporary
1 SIMPLE B index NULL a 5 NULL 20 Using where; Using index; Using join buffer (flat, BNL join)
drop table t0, t1;
mysql-test/t/order_by_optimizer.test
0 → 100644
View file @
4b8e54bb
--
disable_warnings
drop
table
if
exists
t0
,
t1
,
t2
,
t3
;
--
enable_warnings
--
echo
#
--
echo
# MDEV-7885: EXPLAIN shows wrong info for ORDER BY query
--
echo
#
create
table
t0
(
a
int
);
insert
into
t0
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t1
(
a
int
);
insert
into
t1
select
A
.
a
+
B
.
a
*
10
+
C
.
a
*
100
from
t0
A
,
t0
B
,
t0
C
;
create
table
t2
(
key1
int
,
col1
int
,
key
(
key1
));
insert
into
t2
select
a
,
a
from
t0
;
insert
into
t2
select
15
,
15
from
t1
;
alter
table
t2
add
key2
int
,
add
key
(
key2
);
--
echo
# This must show "Using filesort":
explain
select
*
from
t2
ignore
index
for
order
by
(
key1
)
where
col1
<
0
order
by
key1
limit
10
;
drop
table
t0
,
t1
,
t2
;
--
echo
#
--
echo
# MDEV-8857: [Upstream too] EXPLAIN incorrectly shows Distinct for tables using join buffer
--
echo
#
create
table
t0
(
a
int
);
insert
into
t0
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t1
(
a
int
,
filler
char
(
200
),
key
(
a
));
insert
into
t1
select
A
.
a
+
B
.
a
*
10
,
'AAAAAAAAAAAAAAAAAAAA'
from
t0
A
,
t0
B
where
B
.
a
in
(
0
,
1
);
explain
select
distinct
A
.
a
from
t0
A
,
t1
B
where
A
.
a
+
B
.
a
>
0
;
drop
table
t0
,
t1
;
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