[Commits] Rev 3572: Added the test case for bug #54599 into mariadb code line. in file:///home/igor/maria/maria-5.5/

Igor Babaev igor at askmonty.org
Wed Nov 7 09:18:07 EET 2012


At file:///home/igor/maria/maria-5.5/

------------------------------------------------------------
revno: 3572
revision-id: igor at askmonty.org-20121107071807-2umr7o8ssoxyo9vz
parent: wlad at montyprogram.com-20121104212004-mpir1xoc4hzj3i19
committer: Igor Babaev <igor at askmonty.org>
branch nick: maria-5.5
timestamp: Tue 2012-11-06 23:18:07 -0800
message:
  Added the test case for bug #54599 into mariadb code line.
  The fix for this bug was pulled from mysql-5.5 earlier.
-------------- next part --------------
=== modified file 'mysql-test/r/order_by.result'
--- a/mysql-test/r/order_by.result	2012-08-24 11:57:39 +0000
+++ b/mysql-test/r/order_by.result	2012-11-07 07:18:07 +0000
@@ -1945,3 +1945,52 @@
 set sort_buffer_size= @save_sort_buffer_size;
 DROP TABLE t1;
 End of 5.3 tests
+#
+# Bug 54599: discarded fast range scan for query with 
+#            GROUP BY + ORDER BY + LIMIT 
+#
+create table t0 (a int);
+insert into t0 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+create table t1 (a int, b int, index idx1(a,b), index idx2(b,a));
+insert into t1
+select 1000*s4.a+100*s3.a+10*s2.a + s1.a, 1000*s4.a+100*s3.a+10*s2.a+s1.a
+from t0 s1, t0 s2, t0 s3, t0 s4;
+analyze table t1;
+explain
+select b, count(*) num_cnt from t1
+where a > 9750 group by b order by num_cnt;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	idx1	idx1	5	NULL	502	Using where; Using index; Using temporary; Using filesort
+flush status;
+select b, count(*) num_cnt from t1
+where a > 9750 group by b order by num_cnt;
+show status like '%Handler_read%';
+Variable_name	Value
+Handler_read_first	0
+Handler_read_key	250
+Handler_read_last	0
+Handler_read_next	249
+Handler_read_prev	0
+Handler_read_rnd	249
+Handler_read_rnd_deleted	0
+Handler_read_rnd_next	250
+explain
+select b, count(*) num_cnt from t1 
+where a > 9750 group by b order by num_cnt limit 1;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	idx1	idx1	5	NULL	502	Using where; Using index; Using temporary; Using filesort
+flush status;
+select b, count(*) num_cnt from t1 
+where a > 9750 group by b order by num_cnt limit 1;
+show status like '%Handler_read%';
+Variable_name	Value
+Handler_read_first	0
+Handler_read_key	250
+Handler_read_last	0
+Handler_read_next	249
+Handler_read_prev	0
+Handler_read_rnd	1
+Handler_read_rnd_deleted	0
+Handler_read_rnd_next	250
+drop table t0, t1;
+End of 5.5 tests

=== modified file 'mysql-test/t/order_by.test'
--- a/mysql-test/t/order_by.test	2012-08-24 11:57:39 +0000
+++ b/mysql-test/t/order_by.test	2012-11-07 07:18:07 +0000
@@ -1652,3 +1652,44 @@
 
 --echo End of 5.3 tests
 
+--echo #
+--echo # Bug 54599: discarded fast range scan for query with 
+--echo #            GROUP BY + ORDER BY + LIMIT 
+--echo #
+
+create table t0 (a int);
+insert into t0 values (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
+
+create table t1 (a int, b int, index idx1(a,b), index idx2(b,a));
+insert into t1
+  select 1000*s4.a+100*s3.a+10*s2.a + s1.a, 1000*s4.a+100*s3.a+10*s2.a+s1.a
+    from t0 s1, t0 s2, t0 s3, t0 s4;
+--disable_result_log
+analyze table t1;
+--enable_result_log
+
+explain
+select b, count(*) num_cnt from t1
+   where a > 9750 group by b order by num_cnt;
+flush status;
+--disable_result_log
+select b, count(*) num_cnt from t1
+   where a > 9750 group by b order by num_cnt;
+--enable_result_log
+show status like '%Handler_read%';
+
+explain
+select b, count(*) num_cnt from t1 
+  where a > 9750 group by b order by num_cnt limit 1;
+flush status;
+--disable_result_log
+select b, count(*) num_cnt from t1 
+  where a > 9750 group by b order by num_cnt limit 1;
+--enable_result_log
+show status like '%Handler_read%';
+
+drop table t0, t1;
+
+--echo End of 5.5 tests
+
+



More information about the commits mailing list