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
ccb54beb
Commit
ccb54beb
authored
Feb 15, 2014
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
5a21dc7d
8c9b2f34
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
56 additions
and
3 deletions
+56
-3
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+16
-0
mysql-test/r/subselect_sj_jcl6.result
mysql-test/r/subselect_sj_jcl6.result
+16
-0
mysql-test/t/subselect_sj.test
mysql-test/t/subselect_sj.test
+19
-0
sql/opt_subselect.cc
sql/opt_subselect.cc
+1
-0
sql/sql_select.cc
sql/sql_select.cc
+2
-2
sql/sql_select.h
sql/sql_select.h
+2
-1
No files found.
mysql-test/r/subselect_sj.result
View file @
ccb54beb
...
...
@@ -2782,4 +2782,20 @@ db
mysql
information_schema
DROP TABLE t1;
#
# MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (2),(3);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (8),(9);
CREATE TABLE t3 (c INT, INDEX(c));
INSERT INTO t2 VALUES (5),(6);
PREPARE stmt FROM
"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )";
EXECUTE stmt;
a
EXECUTE stmt;
a
DROP TABLE t1,t2,t3;
set optimizer_switch=@subselect_sj_tmp;
mysql-test/r/subselect_sj_jcl6.result
View file @
ccb54beb
...
...
@@ -2796,6 +2796,22 @@ db
information_schema
mysql
DROP TABLE t1;
#
# MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (2),(3);
CREATE TABLE t2 (b INT);
INSERT INTO t2 VALUES (8),(9);
CREATE TABLE t3 (c INT, INDEX(c));
INSERT INTO t2 VALUES (5),(6);
PREPARE stmt FROM
"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )";
EXECUTE stmt;
a
EXECUTE stmt;
a
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 @
ccb54beb
...
...
@@ -2489,5 +2489,24 @@ INSERT INTO t1 VALUES ('mysql'),('information_schema');
SELECT
*
FROM
t1
WHERE
db
IN
(
SELECT
`SCHEMA_NAME`
FROM
information_schema
.
SCHEMATA
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# MDEV-5581: Server crashes in in JOIN::prepare on 2nd execution of PS with materialization+semijoin
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
2
),(
3
);
CREATE
TABLE
t2
(
b
INT
);
INSERT
INTO
t2
VALUES
(
8
),(
9
);
CREATE
TABLE
t3
(
c
INT
,
INDEX
(
c
));
INSERT
INTO
t2
VALUES
(
5
),(
6
);
PREPARE
stmt
FROM
"SELECT * FROM t1 WHERE ( 9, 5 ) IN ( SELECT b, COUNT(*) FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t3 ) )"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DROP
TABLE
t1
,
t2
,
t3
;
# The following command must be the last one the file
set
optimizer_switch
=@
subselect_sj_tmp
;
sql/opt_subselect.cc
View file @
ccb54beb
...
...
@@ -5204,6 +5204,7 @@ bool setup_jtbm_semi_joins(JOIN *join, List<TABLE_LIST> *join_list,
if
(
!
(
*
join_where
)
->
fixed
)
(
*
join_where
)
->
fix_fields
(
join
->
thd
,
join_where
);
}
table
->
table
->
maybe_null
=
test
(
join
->
mixed_implicit_grouping
);
}
if
((
nested_join
=
table
->
nested_join
))
...
...
sql/sql_select.cc
View file @
ccb54beb
...
...
@@ -616,7 +616,7 @@ JOIN::prepare(Item ***rref_pointer_array,
aggregate functions in the SELECT list is a MySQL exptenstion that
is allowed only if the ONLY_FULL_GROUP_BY sql mode is not set.
*/
bool
mixed_implicit_grouping
=
false
;
mixed_implicit_grouping
=
false
;
if
((
~
thd
->
variables
.
sql_mode
&
MODE_ONLY_FULL_GROUP_BY
)
&&
select_lex
->
with_sum_func
&&
!
group_list
)
{
...
...
@@ -655,7 +655,7 @@ JOIN::prepare(Item ***rref_pointer_array,
Note: this loop doesn't touch tables inside merged semi-joins, because
subquery-to-semijoin conversion has not been done yet. This is intended.
*/
if
(
mixed_implicit_grouping
)
if
(
mixed_implicit_grouping
&&
tbl
->
table
)
tbl
->
table
->
maybe_null
=
1
;
}
...
...
sql/sql_select.h
View file @
ccb54beb
...
...
@@ -1111,6 +1111,7 @@ public:
JOIN
*
tmp_join
;
ROLLUP
rollup
;
///< Used with rollup
bool
mixed_implicit_grouping
;
bool
select_distinct
;
///< Set if SELECT DISTINCT
/**
If we have the GROUP BY statement in the query,
...
...
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