Commit 6fb06a7a authored by unknown's avatar unknown

fixed order_by test to make it repeatable

parent aef11cc9
...@@ -513,7 +513,7 @@ KEY FieldKey (FieldKey), ...@@ -513,7 +513,7 @@ KEY FieldKey (FieldKey),
KEY LongField (FieldKey,LongVal), KEY LongField (FieldKey,LongVal),
KEY StringField (FieldKey,StringVal(32)) KEY StringField (FieldKey,StringVal(32))
); );
INSERT INTO t1 VALUES ('0',3,'0'),('1',2,'1'),('1',1,'3'), ('1',0,'2'); 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'),('3',2,'1'),('3',1,'2'),('3','3','3');
EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 ref FieldKey,LongField,StringField LongField 36 const 2 Using where 1 SIMPLE t1 ref FieldKey,LongField,StringField LongField 36 const 2 Using where
...@@ -522,20 +522,20 @@ FieldKey LongVal StringVal ...@@ -522,20 +522,20 @@ FieldKey LongVal StringVal
1 0 2 1 0 2
1 1 3 1 1 3
1 2 1 1 2 1
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 36 NULL 3 Using where; Using filesort 1 SIMPLE t1 range FieldKey,LongField,StringField FieldKey 36 NULL 4 Using where; Using filesort
SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY LongVal; SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
FieldKey LongVal StringVal FieldKey LongVal StringVal
1 0 2 3 1 2
1 1 3 3 2 1
1 2 1 3 3 3
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY FieldKey, LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
id select_type table type possible_keys key key_len ref rows Extra id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range FieldKey,LongField,StringField LongField 36 NULL 3 Using where 1 SIMPLE t1 range FieldKey,LongField,StringField LongField 36 NULL 4 Using where
SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY FieldKey, LongVal; SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
FieldKey LongVal StringVal FieldKey LongVal StringVal
1 0 2 3 1 2
1 1 3 3 2 1
1 2 1 3 3 3
DROP TABLE t1; DROP TABLE t1;
...@@ -344,11 +344,11 @@ CREATE TABLE t1 ( ...@@ -344,11 +344,11 @@ CREATE TABLE t1 (
KEY LongField (FieldKey,LongVal), KEY LongField (FieldKey,LongVal),
KEY StringField (FieldKey,StringVal(32)) KEY StringField (FieldKey,StringVal(32))
); );
INSERT INTO t1 VALUES ('0',3,'0'),('1',2,'1'),('1',1,'3'), ('1',0,'2'); 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'),('3',2,'1'),('3',1,'2'),('3','3','3');
EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal; SELECT * FROM t1 WHERE FieldKey = '1' ORDER BY LongVal;
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY LongVal; SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY LongVal;
EXPLAIN SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY FieldKey, LongVal; EXPLAIN SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
SELECT * FROM t1 WHERE FieldKey > '0' ORDER BY FieldKey, LongVal; SELECT * FROM t1 WHERE FieldKey > '2' ORDER BY FieldKey, LongVal;
DROP TABLE t1; DROP TABLE t1;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment