[Commits] Rev 2802: Fix order_by test failure: don't run EXPLAIN for a query that has multiple in file:///home/psergey/dev2/5.3/

Sergey Petrunya psergey at askmonty.org
Thu Jul 15 17:07:02 EEST 2010


At file:///home/psergey/dev2/5.3/

------------------------------------------------------------
revno: 2802
revision-id: psergey at askmonty.org-20100715140701-byj56us60o073fkd
parent: timour at askmonty.org-20100715135910-y1gvcc3d63sod6xt
committer: Sergey Petrunya <psergey at askmonty.org>
branch nick: 5.3
timestamp: Thu 2010-07-15 18:07:01 +0400
message:
  Fix order_by test failure: don't run EXPLAIN for a query that has multiple
  range plans with identical costs.
=== modified file 'mysql-test/r/order_by.result'
--- a/mysql-test/r/order_by.result	2010-03-20 12:01:47 +0000
+++ b/mysql-test/r/order_by.result	2010-07-15 14:07:01 +0000
@@ -607,9 +607,14 @@
 1	0	2
 1	1	3
 1	2	1
-EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
-id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
-1	SIMPLE	t1	range	FieldKey,LongField,StringField	FieldKey	38	NULL	4	Using index condition; Using where; Using MRR; Using filesort
+DS-MRR: use two IGNORE INDEX queries, otherwise we get cost races, because
+DS-MRR: records_in_range/read_time return the same numbers for all three indexes
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	FieldKey	FieldKey	38	NULL	4	Using index condition; Using MRR; Using filesort
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
+id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
+1	SIMPLE	t1	range	StringField	StringField	38	NULL	4	Using where; Using filesort
 SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
 FieldKey	LongVal	StringVal
 3	1	2

=== modified file 'mysql-test/t/order_by.test'
--- a/mysql-test/t/order_by.test	2010-03-04 08:03:07 +0000
+++ b/mysql-test/t/order_by.test	2010-07-15 14:07:01 +0000
@@ -402,7 +402,11 @@
 INSERT INTO t1 VALUES ('0',3,'0'),('0',2,'1'),('0',1,'2'),('1',2,'1'),('1',1,'3'), ('1',0,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('2',3,'0'),('2',2,'1'),('2',1,'2'),('3',2,'1'),('3',1,'2'),('3','3','3');
 EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
 SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
-EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
+--echo DS-MRR: use two IGNORE INDEX queries, otherwise we get cost races, because
+--echo DS-MRR: records_in_range/read_time return the same numbers for all three indexes
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (LongField, StringField) WHERE FieldKey > '2' ORDER BY LongVal;
+EXPLAIN SELECT * FROM t1 IGNORE INDEX (FieldKey, LongField) WHERE FieldKey > '2' ORDER BY LongVal;
+
 SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
 EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
 SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;



More information about the commits mailing list