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
71422d7b
Commit
71422d7b
authored
May 04, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4 ...
- Added testcase
parent
2a8db1ca
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
63 additions
and
0 deletions
+63
-0
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+18
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+18
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+27
-0
No files found.
mysql-test/r/subselect_sj.result
View file @
71422d7b
...
@@ -2852,4 +2852,22 @@ field1
...
@@ -2852,4 +2852,22 @@ field1
o
o
o
o
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
# (testcase only)
#
SET join_cache_level = 5;
SET optimizer_switch = 'semijoin=on';
CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e');
CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g');
SELECT a, COUNT(*) AS cnt
FROM t1 LEFT JOIN t2 ON (d = b)
WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' )
GROUP BY a ORDER BY a, cnt LIMIT 2;
a cnt
1 1
4 1
drop table t1, t2;
set optimizer_switch=@subselect_sj_tmp;
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
71422d7b
...
@@ -2866,6 +2866,24 @@ field1
...
@@ -2866,6 +2866,24 @@ field1
o
o
o
o
DROP TABLE t1, t2;
DROP TABLE t1, t2;
#
# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
# (testcase only)
#
SET join_cache_level = 5;
SET optimizer_switch = 'semijoin=on';
CREATE TABLE t1 (a INT NOT NULL, b CHAR(1), KEY(a)) ENGINE=MyISAM;
INSERT INTO t1 VALUES (4,'p'),(1,'q'),(8,'e');
CREATE TABLE t2 (c INT, d CHAR(1), KEY(c), KEY(d)) ENGINE=MyISAM;
INSERT INTO t2 VALUES (4,'f'),(2,'i'),(5,'h'),(3,'q'),(1,'g');
SELECT a, COUNT(*) AS cnt
FROM t1 LEFT JOIN t2 ON (d = b)
WHERE a IN ( SELECT c FROM t2 WHERE b > 'k' )
GROUP BY a ORDER BY a, cnt LIMIT 2;
a cnt
1 1
4 1
drop table t1, t2;
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 @
71422d7b
...
@@ -2540,5 +2540,32 @@ WHERE (field1) IN ($query);
...
@@ -2540,5 +2540,32 @@ WHERE (field1) IN ($query);
DROP
TABLE
t1
,
t2
;
DROP
TABLE
t1
,
t2
;
--
echo
#
--
echo
# MDEV-389: Wrong result (missing row) with semijoin, join_cache_level>4, LEFT JOIN...
--
echo
# (testcase only)
--
echo
#
# Use another connection to get rid of this test's settings
connect
(
con1
,
localhost
,
root
,,);
connection
con1
;
SET
join_cache_level
=
5
;
SET
optimizer_switch
=
'semijoin=on'
;
CREATE
TABLE
t1
(
a
INT
NOT
NULL
,
b
CHAR
(
1
),
KEY
(
a
))
ENGINE
=
MyISAM
;
INSERT
INTO
t1
VALUES
(
4
,
'p'
),(
1
,
'q'
),(
8
,
'e'
);
CREATE
TABLE
t2
(
c
INT
,
d
CHAR
(
1
),
KEY
(
c
),
KEY
(
d
))
ENGINE
=
MyISAM
;
INSERT
INTO
t2
VALUES
(
4
,
'f'
),(
2
,
'i'
),(
5
,
'h'
),(
3
,
'q'
),(
1
,
'g'
);
SELECT
a
,
COUNT
(
*
)
AS
cnt
FROM
t1
LEFT
JOIN
t2
ON
(
d
=
b
)
WHERE
a
IN
(
SELECT
c
FROM
t2
WHERE
b
>
'k'
)
GROUP
BY
a
ORDER
BY
a
,
cnt
LIMIT
2
;
drop
table
t1
,
t2
;
connection
default
;
disconnect
con1
;
# 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
;
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