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
d63b9feb
Commit
d63b9feb
authored
Aug 26, 2010
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Automerge.
parents
8f87d12d
8a310d69
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
155 additions
and
9 deletions
+155
-9
mysql-test/r/join.result
mysql-test/r/join.result
+71
-0
mysql-test/t/join.test
mysql-test/t/join.test
+66
-0
sql/field.cc
sql/field.cc
+1
-1
sql/sql_select.cc
sql/sql_select.cc
+16
-8
sql/sql_select.h
sql/sql_select.h
+1
-0
No files found.
mysql-test/r/join.result
View file @
d63b9feb
...
@@ -1184,4 +1184,75 @@ NULL
...
@@ -1184,4 +1184,75 @@ NULL
NULL
NULL
1
1
DROP TABLE t1, t2, mm1;
DROP TABLE t1, t2, mm1;
#
# Bug #55568: user variable assignments crash server when used within
# query
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (0), (1);
SELECT MULTIPOINT(
1,
(
SELECT MULTIPOINT(
MULTIPOINT(
1,
(SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d)
)
) FROM t1
)
) != COUNT(*) q FROM t1 GROUP BY a;
q
NULL
NULL
SELECT MULTIPOINT(
1,
(
SELECT MULTIPOINT(
MULTIPOINT(
1,
(SELECT COUNT(*) FROM (SELECT 1 FROM t1 GROUP BY a,a) d)
)
) FROM t1
)
) != COUNT(*) q FROM t1 GROUP BY a;
q
NULL
NULL
DROP TABLE t1;
#
# Bug #54468: crash after item's print() function when ordering/grouping
# by subquery
#
CREATE TABLE t1(a INT, b INT);
INSERT INTO t1 VALUES (), ();
SELECT 1 FROM t1
GROUP BY
GREATEST(t1.a,
(SELECT 1 FROM
(SELECT t1.b FROM t1,t1 t2
ORDER BY t1.a, t1.a LIMIT 1) AS d)
);
1
1
DROP TABLE t1;
#
# Bug #53544: Server hangs during JOIN query in stored procedure called
# twice in a row
#
CREATE TABLE t1(c INT);
INSERT INTO t1 VALUES (1), (2);
PREPARE stmt FROM "SELECT t2.c AS f1 FROM t1 LEFT JOIN
t1 t2 ON t1.c=t2.c RIGHT JOIN
t1 t3 ON t1.c=t3.c
GROUP BY f1;";
EXECUTE stmt;
f1
1
2
EXECUTE stmt;
f1
1
2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests
End of 5.1 tests
mysql-test/t/join.test
View file @
d63b9feb
...
@@ -851,4 +851,70 @@ ENGINE=MERGE UNION=(t1,t2);
...
@@ -851,4 +851,70 @@ ENGINE=MERGE UNION=(t1,t2);
SELECT
t1
.
a
FROM
mm1
,
t1
;
SELECT
t1
.
a
FROM
mm1
,
t1
;
DROP
TABLE
t1
,
t2
,
mm1
;
DROP
TABLE
t1
,
t2
,
mm1
;
--
echo
#
--
echo
# Bug #55568: user variable assignments crash server when used within
--
echo
# query
--
echo
#
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
0
),
(
1
);
let
$i
=
2
;
while
(
$i
)
{
SELECT
MULTIPOINT
(
1
,
(
SELECT
MULTIPOINT
(
MULTIPOINT
(
1
,
(
SELECT
COUNT
(
*
)
FROM
(
SELECT
1
FROM
t1
GROUP
BY
a
,
a
)
d
)
)
)
FROM
t1
)
)
!=
COUNT
(
*
)
q
FROM
t1
GROUP
BY
a
;
dec
$i
;
}
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #54468: crash after item's print() function when ordering/grouping
--
echo
# by subquery
--
echo
#
CREATE
TABLE
t1
(
a
INT
,
b
INT
);
INSERT
INTO
t1
VALUES
(),
();
SELECT
1
FROM
t1
GROUP
BY
GREATEST
(
t1
.
a
,
(
SELECT
1
FROM
(
SELECT
t1
.
b
FROM
t1
,
t1
t2
ORDER
BY
t1
.
a
,
t1
.
a
LIMIT
1
)
AS
d
)
);
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #53544: Server hangs during JOIN query in stored procedure called
--
echo
# twice in a row
--
echo
#
CREATE
TABLE
t1
(
c
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
PREPARE
stmt
FROM
"SELECT t2.c AS f1 FROM t1 LEFT JOIN
t1 t2 ON t1.c=t2.c RIGHT JOIN
t1 t3 ON t1.c=t3.c
GROUP BY f1;"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
--
echo
End
of
5.1
tests
--
echo
End
of
5.1
tests
sql/field.cc
View file @
d63b9feb
...
@@ -1564,7 +1564,7 @@ void Field::make_field(Send_field *field)
...
@@ -1564,7 +1564,7 @@ void Field::make_field(Send_field *field)
}
}
else
else
field
->
org_table_name
=
field
->
db_name
=
""
;
field
->
org_table_name
=
field
->
db_name
=
""
;
if
(
orig_table
)
if
(
orig_table
&&
orig_table
->
alias
)
{
{
field
->
table_name
=
orig_table
->
alias
;
field
->
table_name
=
orig_table
->
alias
;
field
->
org_col_name
=
field_name
;
field
->
org_col_name
=
field_name
;
...
...
sql/sql_select.cc
View file @
d63b9feb
...
@@ -2402,13 +2402,8 @@ JOIN::destroy()
...
@@ -2402,13 +2402,8 @@ JOIN::destroy()
cleanup
(
1
);
cleanup
(
1
);
/* Cleanup items referencing temporary table columns */
/* Cleanup items referencing temporary table columns */
if
(
!
tmp_all_fields3
.
is_empty
())
cleanup_item_list
(
tmp_all_fields1
);
{
cleanup_item_list
(
tmp_all_fields3
);
List_iterator_fast
<
Item
>
it
(
tmp_all_fields3
);
Item
*
item
;
while
((
item
=
it
++
))
item
->
cleanup
();
}
if
(
exec_tmp_table1
)
if
(
exec_tmp_table1
)
free_tmp_table
(
thd
,
exec_tmp_table1
);
free_tmp_table
(
thd
,
exec_tmp_table1
);
if
(
exec_tmp_table2
)
if
(
exec_tmp_table2
)
...
@@ -2419,6 +2414,19 @@ JOIN::destroy()
...
@@ -2419,6 +2414,19 @@ JOIN::destroy()
DBUG_RETURN
(
error
);
DBUG_RETURN
(
error
);
}
}
void
JOIN
::
cleanup_item_list
(
List
<
Item
>
&
items
)
const
{
if
(
!
items
.
is_empty
())
{
List_iterator_fast
<
Item
>
it
(
items
);
Item
*
item
;
while
((
item
=
it
++
))
item
->
cleanup
();
}
}
/**
/**
An entry point to single-unit select (a select without UNION).
An entry point to single-unit select (a select without UNION).
...
@@ -9008,10 +9016,10 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
...
@@ -9008,10 +9016,10 @@ simplify_joins(JOIN *join, List<TABLE_LIST> *join_list, COND *conds, bool top)
/* Flatten nested joins that can be flattened. */
/* Flatten nested joins that can be flattened. */
TABLE_LIST
*
right_neighbor
=
NULL
;
TABLE_LIST
*
right_neighbor
=
NULL
;
bool
fix_name_res
=
FALSE
;
li
.
rewind
();
li
.
rewind
();
while
((
table
=
li
++
))
while
((
table
=
li
++
))
{
{
bool
fix_name_res
=
FALSE
;
nested_join
=
table
->
nested_join
;
nested_join
=
table
->
nested_join
;
if
(
nested_join
&&
!
table
->
on_expr
)
if
(
nested_join
&&
!
table
->
on_expr
)
{
{
...
...
sql/sql_select.h
View file @
d63b9feb
...
@@ -583,6 +583,7 @@ class JOIN :public Sql_alloc
...
@@ -583,6 +583,7 @@ class JOIN :public Sql_alloc
*/
*/
bool
implicit_grouping
;
bool
implicit_grouping
;
bool
make_simple_join
(
JOIN
*
join
,
TABLE
*
tmp_table
);
bool
make_simple_join
(
JOIN
*
join
,
TABLE
*
tmp_table
);
void
cleanup_item_list
(
List
<
Item
>
&
items
)
const
;
};
};
...
...
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