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
d25f6bb3
Commit
d25f6bb3
authored
Jan 27, 2012
by
Igor Babaev
Browse files
Options
Browse Files
Download
Plain Diff
Merge.
parents
4f4047a2
4e2b6d45
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
143 additions
and
0 deletions
+143
-0
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+52
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+52
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+39
-0
No files found.
mysql-test/r/subselect_sj.result
View file @
d25f6bb3
...
...
@@ -1538,6 +1538,58 @@ deallocate prepare s;
set optimizer_switch=@save_optimizer_switch;
DROP TABLE ot1, ot2, ot3, it1;
#
# Bug#59919/11766739: Crash in tmp_table_param::init() with semijoin=on
#
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER, f2 INTEGER) ENGINE=MyISAM;
CREATE TABLE t3 (f1 INTEGER, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1,1), (2,1);
INSERT INTO t3 VALUES
(1,1), (2,1), (5,4), (7,3), (8,2), (8,1), (7,3),
(9,5), (4,3), (7,2), (7,7), (3,1), (5,8), (9,7);
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='semijoin=off,materialization=on';
EXPLAIN
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 14 Using where
2 MATERIALIZED t1 system NULL NULL NULL NULL 1
2 MATERIALIZED b1 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED b2 ALL NULL NULL NULL NULL 2
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
f1 f2
1 1
2 1
8 1
3 1
set optimizer_switch='semijoin=on,materialization=on';
EXPLAIN
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
1 PRIMARY t3 ALL NULL NULL NULL NULL 14 Using where; Using join buffer (flat, BNL join)
2 MATERIALIZED b1 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED b2 ALL NULL NULL NULL NULL 2
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
f1 f2
1 1
2 1
8 1
3 1
set optimizer_switch=@save_optimizer_switch;
DROP TABLE t1, t2, t3 ;
#
#
# BUG#784723: Wrong result with semijoin + nested subqueries in maria-5.3
#
CREATE TABLE t1 ( t1field integer, primary key (t1field));
...
...
mysql-test/r/subselect_sj_jcl6.result
View file @
d25f6bb3
...
...
@@ -1551,6 +1551,58 @@ deallocate prepare s;
set optimizer_switch=@save_optimizer_switch;
DROP TABLE ot1, ot2, ot3, it1;
#
# Bug#59919/11766739: Crash in tmp_table_param::init() with semijoin=on
#
CREATE TABLE t1 (f1 INTEGER) ENGINE=MyISAM;
CREATE TABLE t2 (f1 INTEGER, f2 INTEGER) ENGINE=MyISAM;
CREATE TABLE t3 (f1 INTEGER, f2 INTEGER) ENGINE=MyISAM;
INSERT INTO t1 VALUES (1);
INSERT INTO t2 VALUES (1,1), (2,1);
INSERT INTO t3 VALUES
(1,1), (2,1), (5,4), (7,3), (8,2), (8,1), (7,3),
(9,5), (4,3), (7,2), (7,7), (3,1), (5,8), (9,7);
set @save_optimizer_switch=@@optimizer_switch;
set optimizer_switch='semijoin=off,materialization=on';
EXPLAIN
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t3 ALL NULL NULL NULL NULL 14 Using where
2 MATERIALIZED t1 system NULL NULL NULL NULL 1
2 MATERIALIZED b1 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED b2 ALL NULL NULL NULL NULL 2
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
f1 f2
1 1
2 1
8 1
3 1
set optimizer_switch='semijoin=on,materialization=on';
EXPLAIN
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 1
1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1
1 PRIMARY t3 ALL NULL NULL NULL NULL 14 Using where; Using join buffer (flat, BNL join)
2 MATERIALIZED b1 ALL NULL NULL NULL NULL 2 Using where
2 MATERIALIZED b2 ALL NULL NULL NULL NULL 2
SELECT * FROM t3
WHERE f2 IN (SELECT t1.f1
FROM t1 LEFT OUTER JOIN (t2 AS b1 JOIN t2 AS b2 ON TRUE) ON TRUE);
f1 f2
1 1
2 1
8 1
3 1
set optimizer_switch=@save_optimizer_switch;
DROP TABLE t1, t2, t3 ;
#
#
# BUG#784723: Wrong result with semijoin + nested subqueries in maria-5.3
#
CREATE TABLE t1 ( t1field integer, primary key (t1field));
...
...
mysql-test/t/subselect_sj.test
View file @
d25f6bb3
...
...
@@ -1353,6 +1353,45 @@ set optimizer_switch=@save_optimizer_switch;
DROP
TABLE
ot1
,
ot2
,
ot3
,
it1
;
--
echo
#
--
echo
# Bug#59919/11766739: Crash in tmp_table_param::init() with semijoin=on
--
echo
#
CREATE
TABLE
t1
(
f1
INTEGER
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t2
(
f1
INTEGER
,
f2
INTEGER
)
ENGINE
=
MyISAM
;
CREATE
TABLE
t3
(
f1
INTEGER
,
f2
INTEGER
)
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
1
);
INSERT
INTO
t2
VALUES
(
1
,
1
),
(
2
,
1
);
INSERT
INTO
t3
VALUES
(
1
,
1
),
(
2
,
1
),
(
5
,
4
),
(
7
,
3
),
(
8
,
2
),
(
8
,
1
),
(
7
,
3
),
(
9
,
5
),
(
4
,
3
),
(
7
,
2
),
(
7
,
7
),
(
3
,
1
),
(
5
,
8
),
(
9
,
7
);
set
@
save_optimizer_switch
=@@
optimizer_switch
;
set
optimizer_switch
=
'semijoin=off,materialization=on'
;
EXPLAIN
SELECT
*
FROM
t3
WHERE
f2
IN
(
SELECT
t1
.
f1
FROM
t1
LEFT
OUTER
JOIN
(
t2
AS
b1
JOIN
t2
AS
b2
ON
TRUE
)
ON
TRUE
);
SELECT
*
FROM
t3
WHERE
f2
IN
(
SELECT
t1
.
f1
FROM
t1
LEFT
OUTER
JOIN
(
t2
AS
b1
JOIN
t2
AS
b2
ON
TRUE
)
ON
TRUE
);
set
optimizer_switch
=
'semijoin=on,materialization=on'
;
EXPLAIN
SELECT
*
FROM
t3
WHERE
f2
IN
(
SELECT
t1
.
f1
FROM
t1
LEFT
OUTER
JOIN
(
t2
AS
b1
JOIN
t2
AS
b2
ON
TRUE
)
ON
TRUE
);
SELECT
*
FROM
t3
WHERE
f2
IN
(
SELECT
t1
.
f1
FROM
t1
LEFT
OUTER
JOIN
(
t2
AS
b1
JOIN
t2
AS
b2
ON
TRUE
)
ON
TRUE
);
set
optimizer_switch
=@
save_optimizer_switch
;
DROP
TABLE
t1
,
t2
,
t3
;
--
echo
#
--
echo
#
--
echo
# BUG#784723: Wrong result with semijoin + nested subqueries in maria-5.3
--
echo
#
...
...
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