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
0a5026b0
Commit
0a5026b0
authored
May 11, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG#779885
parents
fedeacee
30575353
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
113 additions
and
1 deletion
+113
-1
mysql-test/r/subselect.result
mysql-test/r/subselect.result
+20
-0
mysql-test/r/subselect_no_mat.result
mysql-test/r/subselect_no_mat.result
+20
-0
mysql-test/r/subselect_no_opts.result
mysql-test/r/subselect_no_opts.result
+20
-0
mysql-test/r/subselect_no_semijoin.result
mysql-test/r/subselect_no_semijoin.result
+20
-0
mysql-test/t/subselect.test
mysql-test/t/subselect.test
+24
-0
sql/sql_select.cc
sql/sql_select.cc
+9
-1
No files found.
mysql-test/r/subselect.result
View file @
0a5026b0
...
...
@@ -5085,3 +5085,23 @@ GROUP BY b;
b
0
DROP TABLE t1;
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3
#
CREATE TABLE t1 ( f1 int );
INSERT INTO t1 VALUES (19), (20);
CREATE TABLE t2 ( f10 varchar(32) );
INSERT INTO t2 VALUES ('c'),('d');
CREATE TABLE t3 ( f10 varchar(32) );
INSERT INTO t3 VALUES ('a'),('b');
SELECT *
FROM t1
WHERE
( 't' ) IN (
SELECT t3.f10
FROM t3
JOIN t2
ON t2.f10 = t3.f10
);
f1
DROP TABLE t1,t2,t3;
mysql-test/r/subselect_no_mat.result
View file @
0a5026b0
...
...
@@ -5089,6 +5089,26 @@ GROUP BY b;
b
0
DROP TABLE t1;
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3
#
CREATE TABLE t1 ( f1 int );
INSERT INTO t1 VALUES (19), (20);
CREATE TABLE t2 ( f10 varchar(32) );
INSERT INTO t2 VALUES ('c'),('d');
CREATE TABLE t3 ( f10 varchar(32) );
INSERT INTO t3 VALUES ('a'),('b');
SELECT *
FROM t1
WHERE
( 't' ) IN (
SELECT t3.f10
FROM t3
JOIN t2
ON t2.f10 = t3.f10
);
f1
DROP TABLE t1,t2,t3;
set optimizer_switch=default;
select @@optimizer_switch like '%materialization=on%';
@@optimizer_switch like '%materialization=on%'
...
...
mysql-test/r/subselect_no_opts.result
View file @
0a5026b0
...
...
@@ -5086,4 +5086,24 @@ GROUP BY b;
b
0
DROP TABLE t1;
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3
#
CREATE TABLE t1 ( f1 int );
INSERT INTO t1 VALUES (19), (20);
CREATE TABLE t2 ( f10 varchar(32) );
INSERT INTO t2 VALUES ('c'),('d');
CREATE TABLE t3 ( f10 varchar(32) );
INSERT INTO t3 VALUES ('a'),('b');
SELECT *
FROM t1
WHERE
( 't' ) IN (
SELECT t3.f10
FROM t3
JOIN t2
ON t2.f10 = t3.f10
);
f1
DROP TABLE t1,t2,t3;
set optimizer_switch=default;
mysql-test/r/subselect_no_semijoin.result
View file @
0a5026b0
...
...
@@ -5086,4 +5086,24 @@ GROUP BY b;
b
0
DROP TABLE t1;
#
# BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3
#
CREATE TABLE t1 ( f1 int );
INSERT INTO t1 VALUES (19), (20);
CREATE TABLE t2 ( f10 varchar(32) );
INSERT INTO t2 VALUES ('c'),('d');
CREATE TABLE t3 ( f10 varchar(32) );
INSERT INTO t3 VALUES ('a'),('b');
SELECT *
FROM t1
WHERE
( 't' ) IN (
SELECT t3.f10
FROM t3
JOIN t2
ON t2.f10 = t3.f10
);
f1
DROP TABLE t1,t2,t3;
set optimizer_switch=default;
mysql-test/t/subselect.test
View file @
0a5026b0
...
...
@@ -4352,3 +4352,27 @@ SELECT b FROM t1
GROUP
BY
b
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#779885: Crash in eliminate_item_equal with materialization=on in maria-5.3
--
echo
#
CREATE
TABLE
t1
(
f1
int
);
INSERT
INTO
t1
VALUES
(
19
),
(
20
);
CREATE
TABLE
t2
(
f10
varchar
(
32
)
);
INSERT
INTO
t2
VALUES
(
'c'
),(
'd'
);
CREATE
TABLE
t3
(
f10
varchar
(
32
)
);
INSERT
INTO
t3
VALUES
(
'a'
),(
'b'
);
SELECT
*
FROM
t1
WHERE
(
't'
)
IN
(
SELECT
t3
.
f10
FROM
t3
JOIN
t2
ON
t2
.
f10
=
t3
.
f10
);
DROP
TABLE
t1
,
t2
,
t3
;
sql/sql_select.cc
View file @
0a5026b0
...
...
@@ -10199,8 +10199,16 @@ Item *eliminate_item_equal(COND *cond, COND_EQUAL *upper_levels,
{
if
(
eq_item
)
eq_list
.
push_back
(
eq_item
);
/*
If we're inside an SJM-nest (current_sjm!=NULL), and the multi-equality
doesn't include a constant, we should produce equality with the first
of the equals in this SJM.
Item
*
head_item
=
current_sjm
?
current_sjm_head
:
head
;
In other cases, get the "head" item, which is either first of the
equals on top level, or the constant.
*/
Item
*
head_item
=
(
!
item_const
&&
current_sjm
)
?
current_sjm_head
:
head
;
Item
*
head_real_item
=
head_item
->
real_item
();
if
(
head_real_item
->
type
()
==
Item
::
FIELD_ITEM
)
head_item
=
head_real_item
;
...
...
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