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
a9958209
Commit
a9958209
authored
Feb 10, 2012
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
merge
parents
6707174a
bb9a3be6
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
116 additions
and
11 deletions
+116
-11
mysql-test/r/join_outer.result
mysql-test/r/join_outer.result
+58
-0
mysql-test/t/join_outer.test
mysql-test/t/join_outer.test
+57
-0
sql/sql_select.cc
sql/sql_select.cc
+1
-11
No files found.
mysql-test/r/join_outer.result
View file @
a9958209
...
...
@@ -1644,4 +1644,62 @@ NULL
NULL
NULL
DROP TABLE h,m,k;
# BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN
# USED IN GROUP BY
CREATE TABLE t1 (
col_varchar_1024_latin1_key varchar(1024),
col_varchar_10_latin1 varchar(10),
col_int int(11),
pk int(11)
);
CREATE TABLE t2 (
col_int_key int(11),
col_int int(11),
pk int(11)
);
PREPARE prep_stmt_9846 FROM '
SELECT alias1.pk AS field1 FROM
t1 AS alias1
LEFT JOIN
(
t2 AS alias2
RIGHT JOIN
(
t2 AS alias3
JOIN t1 AS alias4
ON 1
)
ON 1
)
ON 1
GROUP BY field1';
execute prep_stmt_9846;
field1
execute prep_stmt_9846;
field1
drop table t1,t2;
#
# Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY
# IS EXECUTED TWICE FROM P
#
CREATE TABLE t1 ( a INT ) ENGINE = MYISAM;
INSERT INTO t1 VALUES (1);
PREPARE prep_stmt FROM '
SELECT 1 AS f FROM t1
LEFT JOIN t1 t2
RIGHT JOIN t1 t3
JOIN t1 t4
ON 1
ON 1
ON 1
GROUP BY f';
EXECUTE prep_stmt;
f
1
EXECUTE prep_stmt;
f
1
DROP TABLE t1;
End of 5.1 tests
mysql-test/t/join_outer.test
View file @
a9958209
...
...
@@ -1216,4 +1216,61 @@ WHERE TABLE1.pk IS NULL;
DROP
TABLE
h
,
m
,
k
;
--
echo
--
echo
# BUG#12567331 - INFINITE LOOP WHEN RESOLVING AN ALIASED COLUMN
--
echo
# USED IN GROUP BY
--
echo
CREATE
TABLE
t1
(
col_varchar_1024_latin1_key
varchar
(
1024
),
col_varchar_10_latin1
varchar
(
10
),
col_int
int
(
11
),
pk
int
(
11
)
);
CREATE
TABLE
t2
(
col_int_key
int
(
11
),
col_int
int
(
11
),
pk
int
(
11
)
);
PREPARE
prep_stmt_9846
FROM
'
SELECT alias1.pk AS field1 FROM
t1 AS alias1
LEFT JOIN
(
t2 AS alias2
RIGHT JOIN
(
t2 AS alias3
JOIN t1 AS alias4
ON 1
)
ON 1
)
ON 1
GROUP BY field1'
;
execute
prep_stmt_9846
;
execute
prep_stmt_9846
;
drop
table
t1
,
t2
;
--
echo
#
--
echo
# Bug #11765810 58813: SERVER THREAD HANGS WHEN JOIN + WHERE + GROUP BY
--
echo
# IS EXECUTED TWICE FROM P
--
echo
#
CREATE
TABLE
t1
(
a
INT
)
ENGINE
=
MYISAM
;
INSERT
INTO
t1
VALUES
(
1
);
PREPARE
prep_stmt
FROM
'
SELECT 1 AS f FROM t1
LEFT JOIN t1 t2
RIGHT JOIN t1 t3
JOIN t1 t4
ON 1
ON 1
ON 1
GROUP BY f'
;
EXECUTE
prep_stmt
;
EXECUTE
prep_stmt
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
sql/sql_select.cc
View file @
a9958209
...
...
@@ -9082,11 +9082,9 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
}
/* Flatten nested joins that can be flattened. */
TABLE_LIST
*
right_neighbor
=
NULL
;
li
.
rewind
();
while
((
table
=
li
++
))
{
bool
fix_name_res
=
FALSE
;
nested_join
=
table
->
nested_join
;
if
(
nested_join
&&
!
table
->
on_expr
)
{
...
...
@@ -9098,15 +9096,7 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
tbl
->
join_list
=
table
->
join_list
;
}
li
.
replace
(
nested_join
->
join_list
);
/* Need to update the name resolution table chain when flattening joins */
fix_name_res
=
TRUE
;
table
=
*
li
.
ref
();
}
if
(
fix_name_res
)
table
->
next_name_resolution_table
=
right_neighbor
?
right_neighbor
->
first_leaf_for_name_resolution
()
:
NULL
;
right_neighbor
=
table
;
}
}
DBUG_RETURN
(
conds
);
}
...
...
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