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
e1e04c3d
Commit
e1e04c3d
authored
Mar 08, 2017
by
Marko Mäkelä
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Correct a merge error.
parent
fc0a6dd5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
54 additions
and
0 deletions
+54
-0
mysql-test/t/subselect_innodb.test
mysql-test/t/subselect_innodb.test
+54
-0
No files found.
mysql-test/t/subselect_innodb.test
View file @
e1e04c3d
...
...
@@ -501,3 +501,57 @@ SELECT * FROM v1, t2 WHERE ( f1, f2 ) IN ( SELECT f1, f1 FROM t1 );
set
join_cache_level
=
default
;
drop
view
v1
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# MDEV-6041: ORDER BY+subqueries: subquery_table.key=outer_table.col is not recongized as binding
--
echo
#
create
table
t1
(
a
int
)
engine
=
innodb
;
insert
into
t1
values
(
0
),(
1
),(
2
),(
3
),(
4
),(
5
),(
6
),(
7
),(
8
),(
9
);
create
table
t2
(
id
int
primary
key
,
key1
int
,
col1
int
,
key
(
key1
)
)
engine
=
innodb
;
insert
into
t2
select
A
.
a
+
B
.
a
*
10
+
C
.
a
*
100
+
D
.
a
*
1000
,
A
.
a
+
10
*
B
.
a
,
123456
from
t1
A
,
t1
B
,
t1
C
,
t1
D
;
--
echo
# Table tsubq:
--
echo
# - must use 'ref' (not 'index'), and must not use 'Using filesort'
--
echo
# - shows a bad estimate for 'rows' (but I'm not sure if one can do better w/o histograms)
explain
select
(
SELECT
concat
(
id
,
'-'
,
key1
,
'-'
,
col1
)
FROM
t2
WHERE
t2
.
key1
=
t1
.
a
ORDER
BY
t2
.
id
ASC
LIMIT
1
)
from
t1
;
--
echo
#
--
echo
# MDEV-6081: ORDER BY+ref(const): selectivity is very incorrect (MySQL Bug#14338686)
--
echo
#
alter
table
t2
add
key2
int
;
update
t2
set
key2
=
key1
;
alter
table
t2
add
key
(
key2
);
analyze
table
t2
;
flush
tables
;
--
echo
# Table tsubq must use 'ref' + Using filesort (not 'index' w/o filesort)
--
replace_column
9
#
explain
select
(
SELECT
concat
(
id
,
'-'
,
key1
,
'-'
,
col1
)
FROM
t2
WHERE
t2
.
key1
=
t1
.
a
ORDER
BY
t2
.
key2
ASC
LIMIT
1
)
from
t1
;
drop
table
t1
,
t2
;
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