mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
after merge fix of 577 task (SCRUM, pre commit to be able to merge with static tables optimization fix)
fixed derived tables with subselect inside
This commit is contained in:
@ -95,7 +95,17 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 8
|
||||
2 DERIVED t1 ALL NULL NULL NULL NULL 4
|
||||
3 UNION t1 ALL NULL NULL NULL NULL 4
|
||||
drop table if exists t1;
|
||||
CREATE TABLE t2 (a int not null);
|
||||
insert into t2 values(1);
|
||||
select * from (select * from t1 where t1.a=(select a from t2 where t2.a=t1.a)) a;
|
||||
a b
|
||||
1 a
|
||||
select * from (select * from t1 where t1.a=(select t2.a from t2 where t2.a=t1.a) union select t1.a, t1.b from t1) a;
|
||||
a b
|
||||
1 a
|
||||
2 b
|
||||
3 c
|
||||
drop table t1, t2;
|
||||
create table t1(a int not null, t char(8), index(a));
|
||||
SELECT * FROM (SELECT * FROM t1) as b ORDER BY a ASC LIMIT 0,20;
|
||||
a t
|
||||
|
Reference in New Issue
Block a user