summaryrefslogtreecommitdiff
path: root/mysql-test
diff options
context:
space:
mode:
authorSergei Golubchik <sergii@pisem.net>2013-03-17 17:44:15 +0100
committerSergei Golubchik <sergii@pisem.net>2013-03-17 17:44:15 +0100
commit3827d70a0edb9b88f30dd64a2d7ee2853524dd4e (patch)
tree133905d84192cd38544d7f9951b47eafecf8e3f2 /mysql-test
parent019f7425b70bb992bf6446a3c9a1dda041a4440d (diff)
downloadmariadb-git-3827d70a0edb9b88f30dd64a2d7ee2853524dd4e.tar.gz
MDEV-4286 Server crashes in Protocol_text::store, stack smashing detected
AVG() returns a double, its max_length is reasonably limited by a double number length, even if the argument is many Kbytes long.
Diffstat (limited to 'mysql-test')
-rw-r--r--mysql-test/r/func_group.result7
-rw-r--r--mysql-test/t/func_group.test8
2 files changed, 15 insertions, 0 deletions
diff --git a/mysql-test/r/func_group.result b/mysql-test/r/func_group.result
index 10450b54781..bd77f800f67 100644
--- a/mysql-test/r/func_group.result
+++ b/mysql-test/r/func_group.result
@@ -2090,3 +2090,10 @@ set @@optimizer_switch=@save_optimizer_switch;
# Cleanup for BUG#46680
#
DROP TABLE IF EXISTS t1,t2,t3,empty1;
+create table t1 (i int, d date);
+insert into t1 values (1, '2008-10-02'), (2, '2010-12-12');
+select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d order by i;
+avg(export_set( 3, 'y', sha(i))) group_concat(d)
+0 2008-10-02
+0 2010-12-12
+drop table t1;
diff --git a/mysql-test/t/func_group.test b/mysql-test/t/func_group.test
index 3e31c61ac37..fef4d3b1de2 100644
--- a/mysql-test/t/func_group.test
+++ b/mysql-test/t/func_group.test
@@ -1372,3 +1372,11 @@ set @@optimizer_switch=@save_optimizer_switch;
--echo #
DROP TABLE IF EXISTS t1,t2,t3,empty1;
+#
+# MDEV-4286 Server crashes in Protocol_text::store, stack smashing detected
+#
+create table t1 (i int, d date);
+insert into t1 values (1, '2008-10-02'), (2, '2010-12-12');
+select avg(export_set( 3, 'y', sha(i))), group_concat(d) from t1 group by d order by i;
+drop table t1;
+