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
82094c57
Commit
82094c57
authored
Aug 16, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
48fd7552
a79f48fb
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
56 additions
and
0 deletions
+56
-0
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+14
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+14
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+16
-0
sql/sql_select.cc
sql/sql_select.cc
+12
-0
No files found.
mysql-test/r/subselect_sj.result
View file @
82094c57
...
...
@@ -1715,4 +1715,18 @@ f1 f2 f3 f3
0 NULL NULL NULL
DROP TABLE t1, t2, t3, t4;
set @tmp803457=@@optimizer_switch;
#
# BUG#818280: crash in do_copy_not_null() in maria-5.3 with semijoin
#
CREATE TABLE t1 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
INSERT IGNORE INTO t1 VALUES (2,7),(1,3),(5,6);
CREATE TABLE t3 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
INSERT IGNORE INTO t3 VALUES (2,7),(1,3),(5,6);
CREATE TABLE t2 ( c1 int NOT NULL , c5 int NOT NULL );
INSERT IGNORE INTO t2 VALUES (2,2),(2,2),(5,6);
SELECT * FROM t1 WHERE c1 IN ( SELECT t3.c1 FROM t3 LEFT JOIN t2 ON t2 .c1 = t3 .c1 WHERE t2.c5 != 0 );
c1 c2
2 7
5 6
DROP TABLE t1, t2, t3;
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
82094c57
...
...
@@ -1726,6 +1726,20 @@ f1 f2 f3 f3
0 NULL NULL NULL
DROP TABLE t1, t2, t3, t4;
set @tmp803457=@@optimizer_switch;
#
# BUG#818280: crash in do_copy_not_null() in maria-5.3 with semijoin
#
CREATE TABLE t1 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
INSERT IGNORE INTO t1 VALUES (2,7),(1,3),(5,6);
CREATE TABLE t3 ( c1 int NOT NULL , c2 int NOT NULL, PRIMARY KEY (c1)) ;
INSERT IGNORE INTO t3 VALUES (2,7),(1,3),(5,6);
CREATE TABLE t2 ( c1 int NOT NULL , c5 int NOT NULL );
INSERT IGNORE INTO t2 VALUES (2,2),(2,2),(5,6);
SELECT * FROM t1 WHERE c1 IN ( SELECT t3.c1 FROM t3 LEFT JOIN t2 ON t2 .c1 = t3 .c1 WHERE t2.c5 != 0 );
c1 c2
2 7
5 6
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 @
82094c57
...
...
@@ -1555,5 +1555,21 @@ SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3 ) WHERE IFNULL(t2.f3,'foo') IN (SELEC
DROP
TABLE
t1
,
t2
,
t3
,
t4
;
set
@
tmp803457
=@@
optimizer_switch
;
--
echo
#
--
echo
# BUG#818280: crash in do_copy_not_null() in maria-5.3 with semijoin
--
echo
#
CREATE
TABLE
t1
(
c1
int
NOT
NULL
,
c2
int
NOT
NULL
,
PRIMARY
KEY
(
c1
))
;
INSERT
IGNORE
INTO
t1
VALUES
(
2
,
7
),(
1
,
3
),(
5
,
6
);
CREATE
TABLE
t3
(
c1
int
NOT
NULL
,
c2
int
NOT
NULL
,
PRIMARY
KEY
(
c1
))
;
INSERT
IGNORE
INTO
t3
VALUES
(
2
,
7
),(
1
,
3
),(
5
,
6
);
CREATE
TABLE
t2
(
c1
int
NOT
NULL
,
c5
int
NOT
NULL
);
INSERT
IGNORE
INTO
t2
VALUES
(
2
,
2
),(
2
,
2
),(
5
,
6
);
SELECT
*
FROM
t1
WHERE
c1
IN
(
SELECT
t3
.
c1
FROM
t3
LEFT
JOIN
t2
ON
t2
.
c1
=
t3
.
c1
WHERE
t2
.
c5
!=
0
);
DROP
TABLE
t1
,
t2
,
t3
;
# The following command must be the last one the file
set
optimizer_switch
=@
subselect_sj_tmp
;
sql/sql_select.cc
View file @
82094c57
...
...
@@ -11928,6 +11928,18 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top,
leave it intact (otherwise it is flattened)
*/
join
->
select_lex
->
sj_nests
.
push_back
(
table
);
/*
Also, walk through semi-join children and mark those that are now
top-level
*/
TABLE_LIST
*
tbl
;
List_iterator
<
TABLE_LIST
>
it
(
nested_join
->
join_list
);
while
((
tbl
=
it
++
))
{
if
(
!
tbl
->
on_expr
&&
tbl
->
table
)
tbl
->
table
->
maybe_null
=
FALSE
;
}
}
else
if
(
nested_join
&&
!
table
->
on_expr
)
{
...
...
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