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
271d9c21
Commit
271d9c21
authored
Jul 06, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG#611704
parents
b792411a
a5a8683f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
98 additions
and
1 deletion
+98
-1
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+30
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+30
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+35
-0
sql/sql_lex.cc
sql/sql_lex.cc
+3
-1
No files found.
mysql-test/r/subselect_sj.result
View file @
271d9c21
...
...
@@ -1562,4 +1562,34 @@ f1
1
1
DROP TABLE t1,t2,t3;
#
# BUG#611704: Crash in replace_where_subcondition with nested subquery and semijoin=on
#
CREATE TABLE t1 ( f1 int) ;
CREATE TABLE t2 ( f1 int) ;
CREATE TABLE t3 ( f1 int) ;
SELECT * FROM (
SELECT t3.*
FROM t2 STRAIGHT_JOIN t3
ON t3.f1
AND (t3.f1 ) IN (
SELECT t1.f1
FROM t1
)
) AS alias1;
f1
DROP TABLE t1,t2,t3;
# BUG#611704: another testcase:
CREATE TABLE t1 ( f1 int(11), f3 varchar(1), f4 varchar(1)) ;
CREATE TABLE t2 ( f2 int(11), KEY (f2));
CREATE TABLE t3 ( f4 varchar(1)) ;
PREPARE st1 FROM '
SELECT *
FROM t1
STRAIGHT_JOIN ( t2 STRAIGHT_JOIN t3 ON t2.f2 )
ON (t1.f3) IN ( SELECT f4 FROM t1 )
';
EXECUTE st1;
f1 f3 f4 f2 f4
DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
271d9c21
...
...
@@ -1571,6 +1571,36 @@ f1
1
1
DROP TABLE t1,t2,t3;
#
# BUG#611704: Crash in replace_where_subcondition with nested subquery and semijoin=on
#
CREATE TABLE t1 ( f1 int) ;
CREATE TABLE t2 ( f1 int) ;
CREATE TABLE t3 ( f1 int) ;
SELECT * FROM (
SELECT t3.*
FROM t2 STRAIGHT_JOIN t3
ON t3.f1
AND (t3.f1 ) IN (
SELECT t1.f1
FROM t1
)
) AS alias1;
f1
DROP TABLE t1,t2,t3;
# BUG#611704: another testcase:
CREATE TABLE t1 ( f1 int(11), f3 varchar(1), f4 varchar(1)) ;
CREATE TABLE t2 ( f2 int(11), KEY (f2));
CREATE TABLE t3 ( f4 varchar(1)) ;
PREPARE st1 FROM '
SELECT *
FROM t1
STRAIGHT_JOIN ( t2 STRAIGHT_JOIN t3 ON t2.f2 )
ON (t1.f3) IN ( SELECT f4 FROM t1 )
';
EXECUTE st1;
f1 f3 f4 f2 f4
DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect_sj_tmp;
#
# BUG#49129: Wrong result with IN-subquery with join_cache_level=6 and firstmatch=off
...
...
mysql-test/t/subselect_sj.test
View file @
271d9c21
...
...
@@ -1424,5 +1424,40 @@ WHERE t1.f1 IN (
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
# BUG#611704: Crash in replace_where_subcondition with nested subquery and semijoin=on
--
echo
#
CREATE
TABLE
t1
(
f1
int
)
;
CREATE
TABLE
t2
(
f1
int
)
;
CREATE
TABLE
t3
(
f1
int
)
;
SELECT
*
FROM
(
SELECT
t3
.*
FROM
t2
STRAIGHT_JOIN
t3
ON
t3
.
f1
AND
(
t3
.
f1
)
IN
(
SELECT
t1
.
f1
FROM
t1
)
)
AS
alias1
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
# BUG#611704: another testcase:
CREATE
TABLE
t1
(
f1
int
(
11
),
f3
varchar
(
1
),
f4
varchar
(
1
))
;
CREATE
TABLE
t2
(
f2
int
(
11
),
KEY
(
f2
));
CREATE
TABLE
t3
(
f4
varchar
(
1
))
;
PREPARE
st1
FROM
'
SELECT *
FROM t1
STRAIGHT_JOIN ( t2 STRAIGHT_JOIN t3 ON t2.f2 )
ON (t1.f3) IN ( SELECT f4 FROM t1 )
'
;
EXECUTE
st1
;
DROP
TABLE
t1
,
t2
,
t3
;
# The following command must be the last one the file
set
optimizer_switch
=@
subselect_sj_tmp
;
sql/sql_lex.cc
View file @
271d9c21
...
...
@@ -3413,6 +3413,8 @@ bool SELECT_LEX::merge_subquery(TABLE_LIST *derived, SELECT_LEX *subq_select,
in_subq
++
)
{
join
->
sj_subselects
.
append
(
join
->
thd
->
mem_root
,
*
in_subq
);
DBUG_ASSERT
((
*
in_subq
)
->
emb_on_expr_nest
!=
NULL
);
if
((
*
in_subq
)
->
emb_on_expr_nest
==
NO_JOIN_NEST
)
(
*
in_subq
)
->
emb_on_expr_nest
=
derived
;
}
}
...
...
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