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
bba3b76c
Commit
bba3b76c
authored
Oct 30, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
09668c01
ac373248
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
111 additions
and
0 deletions
+111
-0
mysql-test/r/join.result
mysql-test/r/join.result
+54
-0
mysql-test/t/join.test
mysql-test/t/join.test
+54
-0
sql/sql_select.cc
sql/sql_select.cc
+3
-0
No files found.
mysql-test/r/join.result
View file @
bba3b76c
...
...
@@ -1063,6 +1063,60 @@ a b c d
127 NULL 127 NULL
128 NULL 128 NULL
DROP TABLE IF EXISTS t1,t2;
#
# Bug #42116: Mysql crash on specific query
#
CREATE TABLE t1 (a INT);
CREATE TABLE t2 (a INT);
CREATE TABLE t3 (a INT, INDEX (a));
CREATE TABLE t4 (a INT);
CREATE TABLE t5 (a INT);
CREATE TABLE t6 (a INT);
INSERT INTO t1 VALUES (1), (1), (1);
INSERT INTO t2 VALUES
(2), (2), (2), (2), (2), (2), (2), (2), (2), (2);
INSERT INTO t3 VALUES
(3), (3), (3), (3), (3), (3), (3), (3), (3), (3);
EXPLAIN
SELECT *
FROM
t1 JOIN t2 ON t1.a = t2.a
LEFT JOIN
(
(
t3 LEFT JOIN t4 ON t3.a = t4.a
)
LEFT JOIN
(
t5 LEFT JOIN t6 ON t5.a = t6.a
)
ON t4.a = t5.a
)
ON t1.a = t3.a;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ALL NULL NULL NULL NULL 3
1 SIMPLE t3 ref a a 5 test.t1.a 2 Using index
1 SIMPLE t4 ALL NULL NULL NULL NULL 0
1 SIMPLE t5 ALL NULL NULL NULL NULL 0
1 SIMPLE t6 ALL NULL NULL NULL NULL 0
1 SIMPLE t2 ALL NULL NULL NULL NULL 10 Using where; Using join buffer
SELECT *
FROM
t1 JOIN t2 ON t1.a = t2.a
LEFT JOIN
(
(
t3 LEFT JOIN t4 ON t3.a = t4.a
)
LEFT JOIN
(
t5 LEFT JOIN t6 ON t5.a = t6.a
)
ON t4.a = t5.a
)
ON t1.a = t3.a;
a a a a a a
DROP TABLE t1,t2,t3,t4,t5,t6;
End of 5.0 tests.
CREATE TABLE t1 (f1 int);
CREATE TABLE t2 (f1 int);
...
...
mysql-test/t/join.test
View file @
bba3b76c
...
...
@@ -730,6 +730,60 @@ SELECT * FROM t1 JOIN t2 ON a=c ORDER BY a;
DROP
TABLE
IF
EXISTS
t1
,
t2
;
--
echo
#
--
echo
# Bug #42116: Mysql crash on specific query
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
CREATE
TABLE
t2
(
a
INT
);
CREATE
TABLE
t3
(
a
INT
,
INDEX
(
a
));
CREATE
TABLE
t4
(
a
INT
);
CREATE
TABLE
t5
(
a
INT
);
CREATE
TABLE
t6
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
1
),
(
1
);
INSERT
INTO
t2
VALUES
(
2
),
(
2
),
(
2
),
(
2
),
(
2
),
(
2
),
(
2
),
(
2
),
(
2
),
(
2
);
INSERT
INTO
t3
VALUES
(
3
),
(
3
),
(
3
),
(
3
),
(
3
),
(
3
),
(
3
),
(
3
),
(
3
),
(
3
);
EXPLAIN
SELECT
*
FROM
t1
JOIN
t2
ON
t1
.
a
=
t2
.
a
LEFT
JOIN
(
(
t3
LEFT
JOIN
t4
ON
t3
.
a
=
t4
.
a
)
LEFT
JOIN
(
t5
LEFT
JOIN
t6
ON
t5
.
a
=
t6
.
a
)
ON
t4
.
a
=
t5
.
a
)
ON
t1
.
a
=
t3
.
a
;
SELECT
*
FROM
t1
JOIN
t2
ON
t1
.
a
=
t2
.
a
LEFT
JOIN
(
(
t3
LEFT
JOIN
t4
ON
t3
.
a
=
t4
.
a
)
LEFT
JOIN
(
t5
LEFT
JOIN
t6
ON
t5
.
a
=
t6
.
a
)
ON
t4
.
a
=
t5
.
a
)
ON
t1
.
a
=
t3
.
a
;
DROP
TABLE
t1
,
t2
,
t3
,
t4
,
t5
,
t6
;
--
echo
End
of
5.0
tests
.
...
...
sql/sql_select.cc
View file @
bba3b76c
...
...
@@ -8964,7 +8964,10 @@ static void restore_prev_nj_state(JOIN_TAB *last)
join
->
cur_embedding_map
&=
~
last_emb
->
nested_join
->
nj_map
;
else
if
(
last_emb
->
nested_join
->
join_list
.
elements
-
1
==
last_emb
->
nested_join
->
counter
)
{
join
->
cur_embedding_map
|=
last_emb
->
nested_join
->
nj_map
;
break
;
}
else
break
;
last_emb
=
last_emb
->
embedding
;
...
...
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