mirror of
https://github.com/MariaDB/server.git
synced 2025-07-30 16:24:05 +03:00
5.3 merge
This commit is contained in:
@ -1,4 +1,6 @@
|
||||
drop table if exists t1,t2,t3;
|
||||
set @save_derived_optimizer_switch=@@optimizer_switch;
|
||||
set optimizer_switch='derived_merge=off,derived_with_keys=off';
|
||||
select * from (select 2 from DUAL) b;
|
||||
2
|
||||
2
|
||||
@ -190,13 +192,13 @@ pla_id test
|
||||
explain SELECT STRAIGHT_JOIN d.pla_id, m2.mat_id FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where; Using join buffer (flat, BNL join)
|
||||
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
|
||||
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
|
||||
explain SELECT STRAIGHT_JOIN d.pla_id, m2.test FROM t1 m2 INNER JOIN (SELECT mp.pla_id, MIN(m1.matintnum) AS matintnum FROM t2 mp INNER JOIN t1 m1 ON mp.mat_id=m1.mat_id GROUP BY mp.pla_id) d ON d.matintnum=m2.matintnum;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY m2 ALL NULL NULL NULL NULL 9
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where
|
||||
1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 Using where; Using join buffer (flat, BNL join)
|
||||
2 DERIVED mp ALL NULL NULL NULL NULL 9 Using temporary; Using filesort
|
||||
2 DERIVED m1 eq_ref PRIMARY PRIMARY 3 test.mp.mat_id 1
|
||||
drop table t1,t2;
|
||||
@ -205,6 +207,7 @@ x
|
||||
1
|
||||
create user mysqltest_1;
|
||||
create table t1 select 1 as a;
|
||||
set optimizer_switch='derived_merge=off,derived_with_keys=off';
|
||||
select 2 as a from (select * from t1) b;
|
||||
ERROR 3D000: No database selected
|
||||
use test;
|
||||
@ -429,7 +432,7 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
|
||||
1 PRIMARY <derived3> ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join)
|
||||
3 DERIVED t1 ALL NULL NULL NULL NULL 2
|
||||
3 DERIVED t3 ALL NULL NULL NULL NULL 2 Using where
|
||||
3 DERIVED t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join)
|
||||
4 SUBQUERY t1 ALL NULL NULL NULL NULL 2
|
||||
2 SUBQUERY <derived5> ALL NULL NULL NULL NULL 2
|
||||
5 DERIVED t2 index NULL b 5 NULL 2 Using index
|
||||
@ -437,3 +440,4 @@ SELECT 1 FROM t1 JOIN v1 ON 1 > (SELECT 1 FROM v2);
|
||||
ERROR 21000: Subquery returns more than 1 row
|
||||
DROP TABLE t1, t2;
|
||||
DROP VIEW v1, v2;
|
||||
set optimizer_switch=@save_derived_optimizer_switch;
|
||||
|
Reference in New Issue
Block a user