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
af3c1dc5
Commit
af3c1dc5
authored
Apr 05, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MWL#90: address review feedback: more test coverage
parent
8fb72428
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
66 additions
and
0 deletions
+66
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+32
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+34
-0
No files found.
mysql-test/r/subselect_sj_mat.result
View file @
af3c1dc5
...
...
@@ -1324,3 +1324,35 @@ a a in (select a from t1)
2 0
drop table t0, t1;
set optimizer_switch='firstmatch=on';
#
# MWL#90, review feedback: check what happens when the subquery
# looks like candidate for MWL#90 checking at the first glance
# but then subselect_hash_sj_engine::init_permanent() discovers
# that it's not possible to perform duplicate removal for the
# selected datatypes, and so materialization isn't applicable after
# all.
#
set @blob_len = 1024;
set @suffix_len = @blob_len - @prefix_len;
create table t1_1024 (a1 blob(1024), a2 blob(1024));
create table t2_1024 (b1 blob(1024), b2 blob(1024));
insert into t1_1024 values
(concat('1 - 00', repeat('x', @suffix_len)), concat('2 - 00', repeat('x', @suffix_len)));
insert into t1_1024 values
(concat('1 - 01', repeat('x', @suffix_len)), concat('2 - 01', repeat('x', @suffix_len)));
insert into t1_1024 values
(concat('1 - 02', repeat('x', @suffix_len)), concat('2 - 02', repeat('x', @suffix_len)));
insert into t2_1024 values
(concat('1 - 01', repeat('x', @suffix_len)), concat('2 - 01', repeat('x', @suffix_len)));
insert into t2_1024 values
(concat('1 - 02', repeat('x', @suffix_len)), concat('2 - 02', repeat('x', @suffix_len)));
insert into t2_1024 values
(concat('1 - 03', repeat('x', @suffix_len)), concat('2 - 03', repeat('x', @suffix_len)));
explain select left(a1,7), left(a2,7) from t1_1024 where (a1,3) in (select substring(b1,1,1024), count(*) from t2_1024 where b1 > '0');
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1_1024 ALL NULL NULL NULL NULL 3 Using where
2 DEPENDENT SUBQUERY t2_1024 ALL NULL NULL NULL NULL 3 Using where
select left(a1,7), left(a2,7) from t1_1024 where (a1,3) in (select substring(b1,1,1024), count(*) from t2_1024 where b1 > '0');
left(a1,7) left(a2,7)
1 - 01x 2 - 01x
drop table t1_1024, t2_1024;
mysql-test/t/subselect_sj_mat.test
View file @
af3c1dc5
...
...
@@ -936,3 +936,37 @@ update t1 set a=123;
execute
s
;
drop
table
t0
,
t1
;
set
optimizer_switch
=
'firstmatch=on'
;
--
echo
#
--
echo
# MWL#90, review feedback: check what happens when the subquery
--
echo
# looks like candidate for MWL#90 checking at the first glance
--
echo
# but then subselect_hash_sj_engine::init_permanent() discovers
--
echo
# that it's not possible to perform duplicate removal for the
--
echo
# selected datatypes, and so materialization isn't applicable after
--
echo
# all.
--
echo
#
set
@
blob_len
=
1024
;
set
@
suffix_len
=
@
blob_len
-
@
prefix_len
;
create
table
t1_1024
(
a1
blob
(
1024
),
a2
blob
(
1024
));
create
table
t2_1024
(
b1
blob
(
1024
),
b2
blob
(
1024
));
insert
into
t1_1024
values
(
concat
(
'1 - 00'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 00'
,
repeat
(
'x'
,
@
suffix_len
)));
insert
into
t1_1024
values
(
concat
(
'1 - 01'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 01'
,
repeat
(
'x'
,
@
suffix_len
)));
insert
into
t1_1024
values
(
concat
(
'1 - 02'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 02'
,
repeat
(
'x'
,
@
suffix_len
)));
insert
into
t2_1024
values
(
concat
(
'1 - 01'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 01'
,
repeat
(
'x'
,
@
suffix_len
)));
insert
into
t2_1024
values
(
concat
(
'1 - 02'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 02'
,
repeat
(
'x'
,
@
suffix_len
)));
insert
into
t2_1024
values
(
concat
(
'1 - 03'
,
repeat
(
'x'
,
@
suffix_len
)),
concat
(
'2 - 03'
,
repeat
(
'x'
,
@
suffix_len
)));
explain
select
left
(
a1
,
7
),
left
(
a2
,
7
)
from
t1_1024
where
(
a1
,
3
)
in
(
select
substring
(
b1
,
1
,
1024
),
count
(
*
)
from
t2_1024
where
b1
>
'0'
);
select
left
(
a1
,
7
),
left
(
a2
,
7
)
from
t1_1024
where
(
a1
,
3
)
in
(
select
substring
(
b1
,
1
,
1024
),
count
(
*
)
from
t2_1024
where
b1
>
'0'
);
drop
table
t1_1024
,
t2_1024
;
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