summaryrefslogtreecommitdiff
path: root/mysql-test/t/bug46080.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/bug46080.test')
-rw-r--r--mysql-test/t/bug46080.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/bug46080.test b/mysql-test/t/bug46080.test
new file mode 100644
index 00000000000..7e56e3ce421
--- /dev/null
+++ b/mysql-test/t/bug46080.test
@@ -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