diff options
Diffstat (limited to 'mysql-test/r/order_by.result')
-rw-r--r-- | mysql-test/r/order_by.result | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/mysql-test/r/order_by.result b/mysql-test/r/order_by.result index 4033996b239..006b507d409 100644 --- a/mysql-test/r/order_by.result +++ b/mysql-test/r/order_by.result @@ -611,3 +611,35 @@ a b 5 2 6 2 drop table t1; +create table t1 (a int not null auto_increment, b int not null, c int not null, d int not null, +key(a,b,d), key(c,b,a)); +create table t2 like t1; +insert into t1 values (NULL, 1, 2, 0), (NULL, 2, 1, 1), (NULL, 3, 4, 2), (NULL, 4, 3, 3); +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +insert into t2 select null, b, c, d from t1; +insert into t1 select null, b, c, d from t2; +optimize table t1; +Table Op Msg_type Msg_text +test.t1 optimize status OK +set @row=10; +insert into t1 select 1, b, c + (@row:=@row - 1) * 10, d - @row from t2 limit 10; +select * from t1 where a=1 and b in (1) order by c, b, a; +a b c d +1 1 2 0 +1 1 12 -1 +1 1 52 -5 +1 1 92 -9 +select * from t1 where a=1 and b in (1); +a b c d +1 1 92 -9 +1 1 52 -5 +1 1 12 -1 +1 1 2 0 +drop table t1, t2; |