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
733f3b56
Commit
733f3b56
authored
Jul 28, 2010
by
Alexey Kopytov
Browse files
Options
Browse Files
Download
Plain Diff
Manual merge from 5.1
parents
6b87df1f
1837dcfe
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
51 additions
and
4 deletions
+51
-4
mysql-test/r/func_gconcat.result
mysql-test/r/func_gconcat.result
+20
-1
mysql-test/t/func_gconcat.test
mysql-test/t/func_gconcat.test
+13
-1
sql/item_sum.cc
sql/item_sum.cc
+18
-1
sql/table.h
sql/table.h
+0
-1
No files found.
mysql-test/r/func_gconcat.result
View file @
733f3b56
...
...
@@ -1003,6 +1003,7 @@ SELECT 1 FROM
1
1
DROP TABLE t1;
End of 5.0 tests
#
# Bug #52397: another crash with explain extended and group_concat
#
...
...
@@ -1018,7 +1019,25 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
Warnings:
Note 1003 select 1 AS `1` from dual
DROP TABLE t1;
End of 5.0 tests
#
# Bug #54476: crash when group_concat and 'with rollup' in prepared statements
#
CREATE TABLE t1 (a INT);
INSERT INTO t1 VALUES (1), (2);
PREPARE stmt FROM "SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP";
EXECUTE stmt;
GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1
2,2
1,1,2,2
EXECUTE stmt;
GROUP_CONCAT(t1.a ORDER BY t1.a)
1,1
2,2
1,1,2,2
DEALLOCATE PREPARE stmt;
DROP TABLE t1;
End of 5.1 tests
DROP TABLE IF EXISTS t1, t2;
CREATE TABLE t1 (a VARCHAR(6), b INT);
CREATE TABLE t2 (a VARCHAR(6), b INT);
...
...
mysql-test/t/func_gconcat.test
View file @
733f3b56
...
...
@@ -708,6 +708,7 @@ SELECT 1 FROM
DROP
TABLE
t1
;
--
echo
End
of
5.0
tests
--
echo
#
--
echo
# Bug #52397: another crash with explain extended and group_concat
...
...
@@ -719,8 +720,19 @@ EXPLAIN EXTENDED SELECT 1 FROM
t1
t2
,
t1
GROUP
BY
t1
.
a
)
AS
d
;
DROP
TABLE
t1
;
--
echo
#
--
echo
# Bug #54476: crash when group_concat and 'with rollup' in prepared statements
--
echo
#
--
echo
End
of
5.0
tests
CREATE
TABLE
t1
(
a
INT
);
INSERT
INTO
t1
VALUES
(
1
),
(
2
);
PREPARE
stmt
FROM
"SELECT GROUP_CONCAT(t1.a ORDER BY t1.a) FROM t1 JOIN t1 t2 GROUP BY t1.a WITH ROLLUP"
;
EXECUTE
stmt
;
EXECUTE
stmt
;
DEALLOCATE
PREPARE
stmt
;
DROP
TABLE
t1
;
#
# Bug#36785: Wrong error message when group_concat() exceeds max length
...
...
sql/item_sum.cc
View file @
733f3b56
...
...
@@ -3058,7 +3058,6 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
tree
(
item
->
tree
),
unique_filter
(
item
->
unique_filter
),
table
(
item
->
table
),
order
(
item
->
order
),
context
(
item
->
context
),
arg_count_order
(
item
->
arg_count_order
),
arg_count_field
(
item
->
arg_count_field
),
...
...
@@ -3071,6 +3070,24 @@ Item_func_group_concat::Item_func_group_concat(THD *thd,
{
quick_group
=
item
->
quick_group
;
result
.
set_charset
(
collation
.
collation
);
/*
Since the ORDER structures pointed to by the elements of the 'order' array
may be modified in find_order_in_list() called from
Item_func_group_concat::setup(), create a copy of those structures so that
such modifications done in this object would not have any effect on the
object being copied.
*/
ORDER
*
tmp
;
if
(
!
(
order
=
(
ORDER
**
)
thd
->
alloc
(
sizeof
(
ORDER
*
)
*
arg_count_order
+
sizeof
(
ORDER
)
*
arg_count_order
)))
return
;
tmp
=
(
ORDER
*
)(
order
+
arg_count_order
);
for
(
uint
i
=
0
;
i
<
arg_count_order
;
i
++
,
tmp
++
)
{
memcpy
(
tmp
,
item
->
order
[
i
],
sizeof
(
ORDER
));
order
[
i
]
=
tmp
;
}
}
...
...
sql/table.h
View file @
733f3b56
...
...
@@ -205,7 +205,6 @@ typedef struct st_order {
struct
st_order
*
next
;
Item
**
item
;
/* Point at item in select fields */
Item
*
item_ptr
;
/* Storage for initial item */
Item
**
item_copy
;
/* For SPs; the original item ptr */
int
counter
;
/* position in SELECT list, correct
only if counter_used is true*/
bool
asc
;
/* true if ascending */
...
...
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