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
2ead54d0
Commit
2ead54d0
authored
Aug 21, 2013
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
5d5f3a1e
f8af4423
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
50 additions
and
2 deletions
+50
-2
mysql-test/r/subselect_mat.result
mysql-test/r/subselect_mat.result
+14
-0
mysql-test/r/subselect_sj_mat.result
mysql-test/r/subselect_sj_mat.result
+14
-0
mysql-test/t/subselect_sj_mat.test
mysql-test/t/subselect_sj_mat.test
+18
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+4
-2
No files found.
mysql-test/r/subselect_mat.result
View file @
2ead54d0
...
...
@@ -2016,6 +2016,20 @@ drop table t1,t2;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
#
# MDEV-4908: Assertion `((Item_cond *) cond)->functype() ==
# ((Item_cond *) new_item)->functype()' fails on a query with
# IN and equal conditions, AND/OR, materialization+semijoin
#
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch = 'materialization=on,semijoin=on';
CREATE TABLE t1 (pk INT, a INT, b INT, PRIMARY KEY(pk)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,3,5),(2,4,6);
SELECT * FROM t1 WHERE 8 IN ( SELECT MIN(pk) FROM t1 ) AND ( pk = a OR pk = b );
pk a b
drop table t1;
SET optimizer_switch=@save_optimizer_switch;
# End of 5.3 tests
set @subselect_mat_test_optimizer_switch_value=null;
set @@optimizer_switch='materialization=on,in_to_exists=off,semijoin=off';
set optimizer_switch='mrr=on,mrr_sort_keys=on,index_condition_pushdown=on';
...
...
mysql-test/r/subselect_sj_mat.result
View file @
2ead54d0
...
...
@@ -2056,3 +2056,17 @@ drop table t1,t2;
# This must be at the end:
set optimizer_switch=@subselect_sj_mat_tmp;
set join_cache_level=@save_join_cache_level;
#
# MDEV-4908: Assertion `((Item_cond *) cond)->functype() ==
# ((Item_cond *) new_item)->functype()' fails on a query with
# IN and equal conditions, AND/OR, materialization+semijoin
#
SET @save_optimizer_switch=@@optimizer_switch;
SET optimizer_switch = 'materialization=on,semijoin=on';
CREATE TABLE t1 (pk INT, a INT, b INT, PRIMARY KEY(pk)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1,3,5),(2,4,6);
SELECT * FROM t1 WHERE 8 IN ( SELECT MIN(pk) FROM t1 ) AND ( pk = a OR pk = b );
pk a b
drop table t1;
SET optimizer_switch=@save_optimizer_switch;
# End of 5.3 tests
mysql-test/t/subselect_sj_mat.test
View file @
2ead54d0
...
...
@@ -1700,3 +1700,21 @@ drop table t1,t2;
set
optimizer_switch
=@
subselect_sj_mat_tmp
;
set
join_cache_level
=@
save_join_cache_level
;
--
echo
#
--
echo
# MDEV-4908: Assertion `((Item_cond *) cond)->functype() ==
--
echo
# ((Item_cond *) new_item)->functype()' fails on a query with
--
echo
# IN and equal conditions, AND/OR, materialization+semijoin
--
echo
#
SET
@
save_optimizer_switch
=@@
optimizer_switch
;
SET
optimizer_switch
=
'materialization=on,semijoin=on'
;
CREATE
TABLE
t1
(
pk
INT
,
a
INT
,
b
INT
,
PRIMARY
KEY
(
pk
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
,
3
,
5
),(
2
,
4
,
6
);
SELECT
*
FROM
t1
WHERE
8
IN
(
SELECT
MIN
(
pk
)
FROM
t1
)
AND
(
pk
=
a
OR
pk
=
b
);
drop
table
t1
;
SET
optimizer_switch
=@
save_optimizer_switch
;
--
echo
# End of 5.3 tests
sql/opt_subselect.cc
View file @
2ead54d0
...
...
@@ -5211,10 +5211,12 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
{
eq_cond
=
new
Item_func_eq
(
subq_pred
->
left_expr
->
element_index
(
i
),
new_sink
->
row
[
i
]);
if
(
!
eq_cond
||
eq_cond
->
fix_fields
(
join
->
thd
,
&
eq_cond
)
)
if
(
!
eq_cond
)
DBUG_RETURN
(
1
);
(
*
join_where
)
=
and_items
(
*
join_where
,
eq_cond
);
if
(
!
((
*
join_where
)
=
and_items
(
*
join_where
,
eq_cond
))
||
(
*
join_where
)
->
fix_fields
(
join
->
thd
,
join_where
))
DBUG_RETURN
(
1
);
}
}
else
...
...
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