mirror of
https://github.com/MariaDB/server.git
synced 2025-08-01 03:47:19 +03:00
Added test case for the bug #3155: strange results with index (x, y) ... WHERE x=val_1 AND y>=val_2 ORDER BY pk;
(thankee Monty) mysql-test/r/order_by.result: Added test case for the bug #3155: strange results with index (x, y) ... WHERE x=val_1 AND y>=val_2 ORDER BY pk; mysql-test/t/order_by.test: Added test case for the bug #3155: strange results with index (x, y) ... WHERE x=val_1 AND y>=val_2 ORDER BY pk;
This commit is contained in:
@ -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;
|
||||
|
Reference in New Issue
Block a user