summaryrefslogtreecommitdiff
path: root/mysql-test/t/count_distinct.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/t/count_distinct.test')
-rw-r--r--mysql-test/t/count_distinct.test16
1 files changed, 16 insertions, 0 deletions
diff --git a/mysql-test/t/count_distinct.test b/mysql-test/t/count_distinct.test
index 10b4ac6f0e7..a00574b6cba 100644
--- a/mysql-test/t/count_distinct.test
+++ b/mysql-test/t/count_distinct.test
@@ -107,3 +107,19 @@ create view v1 as select * from t1;
select count(distinct i) from v1;
drop table t1;
drop view v1;
+
+#
+# MDEV-12136 SELECT COUNT(DISTINCT) returns the wrong value when tmp_table_size is limited
+#
+create table t1 (user_id char(64) character set utf8);
+insert t1 values(1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),(12),(13),(14),(15),(16),(17);
+set @@tmp_table_size = 1024;
+select count(distinct user_id) from t1;
+alter table t1 modify user_id char(128) character set utf8;
+select count(distinct user_id) from t1;
+drop table t1;
+set @@tmp_table_size = default;
+
+#
+# End of 5.5 tests
+#