summaryrefslogtreecommitdiff
path: root/mysql-test/t/count_distinct3.test
diff options
context:
space:
mode:
authorPatrick Crews <patrick.crews@sun.com>2009-04-16 13:47:44 -0400
committerPatrick Crews <patrick.crews@sun.com>2009-04-16 13:47:44 -0400
commit5b05d360b0003de4aaa8b0e88d7a70d5c70dfb72 (patch)
tree7a0e79be02899dcf22e51c42d3c0a87f180de463 /mysql-test/t/count_distinct3.test
parent9301da563fa9643648413aedc2eadce72097d317 (diff)
downloadmariadb-git-5b05d360b0003de4aaa8b0e88d7a70d5c70dfb72.tar.gz
Bug#26887 - main.count_distinct3 fails randomly
Streamlined how we increase the size of our test table. The new method shows run time decreased by ~60%. This is not a guarantee that we will not see test timeouts (the random failures noted in the bug), but it should significantly reduce the chances of this occurring.
Diffstat (limited to 'mysql-test/t/count_distinct3.test')
-rw-r--r--mysql-test/t/count_distinct3.test39
1 files changed, 14 insertions, 25 deletions
diff --git a/mysql-test/t/count_distinct3.test b/mysql-test/t/count_distinct3.test
index f817b2c635d..2f7cf7e5260 100644
--- a/mysql-test/t/count_distinct3.test
+++ b/mysql-test/t/count_distinct3.test
@@ -1,4 +1,4 @@
-#
+# Bug #958 a big table without indices and select with group by doesnt work
# this is a test for error 1032 in count(distinct) + group by, introduced in
# mysql-4.1
#
@@ -21,27 +21,16 @@ while ($1)
INSERT INTO t1 (id, grp, id_rev) VALUES (@id, @grp, @id_rev);
dec $1;
}
-set @@read_buffer_size=2*1024*1024;
-CREATE TABLE t2 SELECT * FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-INSERT INTO t1 (id, grp, id_rev) SELECT id, grp, id_rev FROM t2;
-INSERT INTO t2 (id, grp, id_rev) SELECT id, grp, id_rev FROM t1;
-DROP TABLE t2;
+
+# We increase the size of t1 here.
+SET @orig_myisam_sort_buffer_size = @@session.myisam_sort_buffer_size;
+SET session myisam_sort_buffer_size=20000000;
+INSERT INTO t1
+SELECT A.id, A.grp, A.id_rev
+FROM
+ t1 A,
+ (SELECT * FROM t1 B LIMIT 100) B,
+ (SELECT * FROM t1 Z LIMIT 42) Z;
--enable_query_log
SELECT COUNT(*) FROM t1;
@@ -49,12 +38,12 @@ SELECT COUNT(*) FROM t1;
# As t1 contains random numbers, results are different from test to test.
# That's okay, because we test only that select doesn't yield an
# error. Note, that --disable_result_log doesn't suppress error output.
-
--disable_result_log
SELECT COUNT(DISTINCT id) FROM t1 GROUP BY grp;
--enable_result_log
-DROP TABLE t1;
-set @@read_buffer_size=default;
+--echo # Begin cleanup
+SET session myisam_sort_buffer_size = @orig_myisam_sort_buffer_size;
+DROP TABLE t1;
# End of 4.1 tests