1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-30 16:24:05 +03:00

Minor fixes of the patch for BUG#6303

mysql-test/r/group_min_max.result:
  Test results for BUG#6303
mysql-test/t/group_min_max.test:
  Ucommented tests for BUG#6303
sql/opt_range.cc:
  Comment fix
This commit is contained in:
unknown
2004-11-01 10:12:39 +02:00
parent 4cdb957bf6
commit de691e1705
3 changed files with 35 additions and 14 deletions

View File

@ -1354,6 +1354,18 @@ c a a b311 d311
c a b e312 h312
d a a b411 d411
d a b e412 h412
explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c = t1.c )
group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 index NULL idx_t1_1 163 NULL 128 Using where; Using index
2 DEPENDENT SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c > 'b1' )
group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by
2 SUBQUERY t2 index NULL idx_t2_1 163 NULL 164 Using index
explain select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 147 NULL 17 Using where; Using index for group-by
@ -1637,6 +1649,14 @@ a1 a2 b
select distinct b from t2 where (a2 >= 'b') and (b = 'a');
b
a
select distinct t_00.a1
from t1 t_00
where exists ( select * from t2 where a1 = t_00.a1 );
a1
a
b
c
d
explain select distinct a1,a2,b from t1;
id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE t1 range NULL idx_t1_1 147 NULL 17 Using index for group-by

View File

@ -372,15 +372,15 @@ select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group
select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
select a1,a2,b,min(c),max(c) from t2 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
#-- analyze the sub-select
#explain select a1,a2,b,min(c),max(c) from t1
#where exists ( select * from t2 where t2.c = t1.c )
#group by a1,a2,b;
-- analyze the sub-select
explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c = t1.c )
group by a1,a2,b;
#-- the sub-select is unrelated to MIN/MAX
#explain select a1,a2,b,min(c),max(c) from t1
#where exists ( select * from t2 where t2.c > 'b1' )
#group by a1,a2,b;
-- the sub-select is unrelated to MIN/MAX
explain select a1,a2,b,min(c),max(c) from t1
where exists ( select * from t2 where t2.c > 'b1' )
group by a1,a2,b;
-- A,B,C) Predicates referencing mixed classes of attributes
@ -474,10 +474,10 @@ select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121
select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
select distinct b from t2 where (a2 >= 'b') and (b = 'a');
#-- BUG 6303
#select distinct t_00.a1
#from t1 t_00
#where exists ( select * from t2 where a1 = t_00.a1 );
-- BUG 6303
select distinct t_00.a1
from t1 t_00
where exists ( select * from t2 where a1 = t_00.a1 );
--