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
4bcd5baa
Commit
4bcd5baa
authored
Sep 17, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
999c37bb
27cd8d7b
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
9 deletions
+43
-9
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+12
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+12
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+13
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+6
-9
No files found.
mysql-test/r/subselect_sj.result
View file @
4bcd5baa
...
@@ -1891,4 +1891,16 @@ LIMIT 100;
...
@@ -1891,4 +1891,16 @@ LIMIT 100;
drop table t1,t2, t3;
drop table t1,t2, t3;
set optimizer_switch=@tmp_830993;
set optimizer_switch=@tmp_830993;
set join_buffer_size= @tmp_830993_jbs;
set join_buffer_size= @tmp_830993_jbs;
#
# BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared statement with semijoin
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int, b int) ;
PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)";
EXECUTE st1;
a a
EXECUTE st1;
a a
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_sj_tmp;
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
4bcd5baa
...
@@ -1902,6 +1902,18 @@ LIMIT 100;
...
@@ -1902,6 +1902,18 @@ LIMIT 100;
drop table t1,t2, t3;
drop table t1,t2, t3;
set optimizer_switch=@tmp_830993;
set optimizer_switch=@tmp_830993;
set join_buffer_size= @tmp_830993_jbs;
set join_buffer_size= @tmp_830993_jbs;
#
# BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared statement with semijoin
#
CREATE TABLE t1 (a int);
CREATE TABLE t2 (a int);
CREATE TABLE t3 (a int, b int) ;
PREPARE st1 FROM "SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)";
EXECUTE st1;
a a
EXECUTE st1;
a a
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_sj_tmp;
set optimizer_switch=@subselect_sj_tmp;
#
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
...
...
mysql-test/t/subselect_sj.test
View file @
4bcd5baa
...
@@ -1722,5 +1722,18 @@ drop table t1,t2, t3;
...
@@ -1722,5 +1722,18 @@ drop table t1,t2, t3;
set
optimizer_switch
=@
tmp_830993
;
set
optimizer_switch
=@
tmp_830993
;
set
join_buffer_size
=
@
tmp_830993_jbs
;
set
join_buffer_size
=
@
tmp_830993_jbs
;
--
echo
#
--
echo
# BUG##849717: Crash in Item_func::fix_fields on second execution of a prepared statement with semijoin
--
echo
#
CREATE
TABLE
t1
(
a
int
);
CREATE
TABLE
t2
(
a
int
);
CREATE
TABLE
t3
(
a
int
,
b
int
)
;
PREPARE
st1
FROM
"SELECT * FROM t2 LEFT JOIN t1 ON t2.a != 0 AND ('j','r') IN ( SELECT b,a FROM t3)"
;
EXECUTE
st1
;
EXECUTE
st1
;
DROP
TABLE
t1
,
t2
,
t3
;
# The following command must be the last one the file
# The following command must be the last one the file
set
optimizer_switch
=@
subselect_sj_tmp
;
set
optimizer_switch
=@
subselect_sj_tmp
;
sql/opt_subselect.cc
View file @
4bcd5baa
...
@@ -886,12 +886,6 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
...
@@ -886,12 +886,6 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
do_fix_fields
))
do_fix_fields
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
in_subq
->
substitution
=
NULL
;
in_subq
->
substitution
=
NULL
;
#if 0
/*
Don't do the following, because the simplify_join() call is after this
call, and that call will save to prep_wher/prep_on_expr.
*/
/*
/*
If this is a prepared statement, repeat the above operation for
If this is a prepared statement, repeat the above operation for
prep_where (or prep_on_expr). Subquery-to-semijoin conversion is
prep_where (or prep_on_expr). Subquery-to-semijoin conversion is
...
@@ -902,12 +896,15 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
...
@@ -902,12 +896,15 @@ bool convert_join_subqueries_to_semijoins(JOIN *join)
tree
=
(
in_subq
->
emb_on_expr_nest
==
NO_JOIN_NEST
)
?
tree
=
(
in_subq
->
emb_on_expr_nest
==
NO_JOIN_NEST
)
?
&
join
->
select_lex
->
prep_where
:
&
join
->
select_lex
->
prep_where
:
&
(
in_subq
->
emb_on_expr_nest
->
prep_on_expr
);
&
(
in_subq
->
emb_on_expr_nest
->
prep_on_expr
);
/*
if (replace_where_subcondition(join, tree, replace_me, substitute,
prep_on_expr/ prep_where may be NULL in some cases.
If that is the case, do nothing - simplify_joins() will copy
ON/WHERE expression into prep_on_expr/prep_where.
*/
if
(
*
tree
&&
replace_where_subcondition
(
join
,
tree
,
replace_me
,
substitute
,
FALSE
))
FALSE
))
DBUG_RETURN
(
TRUE
);
DBUG_RETURN
(
TRUE
);
}
}
#endif
/*
/*
Revert to the IN->EXISTS strategy in the rare case when the subquery could
Revert to the IN->EXISTS strategy in the rare case when the subquery could
not be flattened.
not be flattened.
...
...
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