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
598c8e93
Commit
598c8e93
authored
Jul 10, 2009
by
Georgi Kodinov
Browse files
Options
Browse Files
Download
Plain Diff
automerge
parents
58081688
5a680959
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
0 deletions
+39
-0
mysql-test/r/bug46080.result
mysql-test/r/bug46080.result
+14
-0
mysql-test/t/bug46080-master.opt
mysql-test/t/bug46080-master.opt
+1
-0
mysql-test/t/bug46080.test
mysql-test/t/bug46080.test
+19
-0
sql/item_sum.cc
sql/item_sum.cc
+5
-0
No files found.
mysql-test/r/bug46080.result
0 → 100644
View file @
598c8e93
#
# Bug #46080: group_concat(... order by) crashes server when
# sort_buffer_size cannot allocate
#
CREATE TABLE t1(a CHAR(255));
INSERT INTO t1 VALUES ('a');
SET @@SESSION.sort_buffer_size=5*16*1000000;
SET @@SESSION.max_heap_table_size=5*1000000;
# Must not crash.
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a
DROP TABLE t1;
SET @@SESSION.sort_buffer_size=default;
SET @@SESSION.max_heap_table_size=default;
End of 5.0 tests
mysql-test/t/bug46080-master.opt
0 → 100644
View file @
598c8e93
--skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=4000000
mysql-test/t/bug46080.test
0 → 100644
View file @
598c8e93
--
echo
#
--
echo
# Bug #46080: group_concat(... order by) crashes server when
--
echo
# sort_buffer_size cannot allocate
--
echo
#
CREATE
TABLE
t1
(
a
CHAR
(
255
));
INSERT
INTO
t1
VALUES
(
'a'
);
SET
@@
SESSION
.
sort_buffer_size
=
5
*
16
*
1000000
;
SET
@@
SESSION
.
max_heap_table_size
=
5
*
1000000
;
echo
# Must not crash.
SELECT
GROUP_CONCAT
(
a
ORDER
BY
a
)
FROM
t1
GROUP
BY
a
;
DROP
TABLE
t1
;
SET
@@
SESSION
.
sort_buffer_size
=
default
;
SET
@@
SESSION
.
max_heap_table_size
=
default
;
--
echo
End
of
5.0
tests
sql/item_sum.cc
View file @
598c8e93
...
...
@@ -3327,8 +3327,13 @@ bool Item_func_group_concat::add()
TREE_ELEMENT
*
el
=
0
;
// Only for safety
if
(
row_eligible
&&
tree
)
{
el
=
tree_insert
(
tree
,
table
->
record
[
0
]
+
table
->
s
->
null_bytes
,
0
,
tree
->
custom_arg
);
/* check if there was enough memory to insert the row */
if
(
!
el
)
return
1
;
}
/*
If the row is not a duplicate (el->count == 1)
we can dump the row here in case of GROUP_CONCAT(DISTINCT...)
...
...
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