mirror of
https://github.com/MariaDB/server.git
synced 2025-01-18 13:02:28 +01:00
Merge main 5.0 into 5.0-build
This commit is contained in:
commit
f39f36c6c8
5 changed files with 49 additions and 2 deletions
|
@ -44,8 +44,13 @@ check_cpu () {
|
|||
model_name=`sysctl -n hw.model`
|
||||
;;
|
||||
Darwin)
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
cpu_family=`sysctl -n machdep.cpu.vendor`
|
||||
model_name=`sysctl -n machdep.cpu.brand_string`
|
||||
if [ -z "$cpu_family" -o -z "$model_name" ]
|
||||
then
|
||||
cpu_family=`uname -p`
|
||||
model_name=`machine`
|
||||
fi
|
||||
;;
|
||||
*)
|
||||
cpu_family=`uname -m`;
|
||||
|
|
14
mysql-test/r/bug46080.result
Normal file
14
mysql-test/r/bug46080.result
Normal file
|
@ -0,0 +1,14 @@
|
|||
#
|
||||
# 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
|
1
mysql-test/t/bug46080-master.opt
Normal file
1
mysql-test/t/bug46080-master.opt
Normal file
|
@ -0,0 +1 @@
|
|||
--skip-grant-tables --skip-name-resolve --safemalloc-mem-limit=4000000
|
22
mysql-test/t/bug46080.test
Normal file
22
mysql-test/t/bug46080.test
Normal file
|
@ -0,0 +1,22 @@
|
|||
--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.
|
||||
--disable_result_log
|
||||
--error 0,5
|
||||
SELECT GROUP_CONCAT(a ORDER BY a) FROM t1 GROUP BY a;
|
||||
--enable_result_log
|
||||
|
||||
DROP TABLE t1;
|
||||
SET @@SESSION.sort_buffer_size=default;
|
||||
SET @@SESSION.max_heap_table_size=default;
|
||||
|
||||
--echo End of 5.0 tests
|
|
@ -3291,8 +3291,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...)
|
||||
|
|
Loading…
Reference in a new issue