mirror of
https://github.com/MariaDB/server.git
synced 2025-01-30 10:31:54 +01:00
Fixes to merge from 4.1
client/mysqldump.c: Temporarily disable unused (and broken) code. mysql-test/r/group_min_max.result: Update results mysql-test/r/mysqldump.result: Update results mysql-test/r/subselect.result: Update results mysql-test/t/group_min_max.test: Ignore number of rows in output of most explain results sql/sql_insert.cc: Fix reference to max_unique_length
This commit is contained in:
parent
2de8a4bc8c
commit
3e2988d00f
6 changed files with 791 additions and 51 deletions
|
@ -2694,8 +2694,11 @@ static my_bool get_view_structure(char *table, char* db)
|
|||
if (verbose)
|
||||
fprintf(stderr, "-- Retrieving view structure for table %s...\n", table);
|
||||
|
||||
#ifdef NOT_REALLY_USED_YET
|
||||
sprintf(insert_pat,"SET OPTION SQL_QUOTE_SHOW_CREATE=%d",
|
||||
(opt_quoted || opt_keywords));
|
||||
#endif
|
||||
|
||||
result_table= quote_name(table, table_buff, 1);
|
||||
opt_quoted_table= quote_name(table, table_buff2, 0);
|
||||
|
||||
|
|
|
@ -148,7 +148,7 @@ 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
|
||||
explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 # NULL 21 Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
|
||||
explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx_t1_1 65 NULL 5 Using index for group-by
|
||||
|
@ -320,40 +320,40 @@ 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 14 Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 14 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 14 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 17 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 17 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 9 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 9 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 9 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 9 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 14 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
select a1,a2,b,min(c),max(c) from t1 where a1 < 'd' group by a1,a2,b;
|
||||
a1 a2 b min(c) max(c)
|
||||
a a a a111 d111
|
||||
|
@ -846,7 +846,7 @@ a a NULL a777 a999
|
|||
c a NULL c777 c999
|
||||
explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
|
||||
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 where; Using index for group-by
|
||||
1 SIMPLE t1 range NULL idx_t1_1 147 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
|
||||
|
@ -894,49 +894,49 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 range NULL idx_t1_1 163 NULL 17 Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain 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;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
|
||||
a1 a2 b max(c)
|
||||
a a a d111
|
||||
|
@ -1389,22 +1389,22 @@ 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 where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 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 t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 163 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
select a1,a2,b,min(c),max(c) from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
|
||||
a1 a2 b min(c) max(c)
|
||||
a a b e112 h112
|
||||
|
@ -1503,16 +1503,16 @@ 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 14 Using where; Using index for group-by
|
||||
explain select a1,a2,b from t2 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 t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b from t2 where (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 t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 index NULL idx_t2_1 163 NULL # Using where; Using index
|
||||
explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
select a1,a2,b from t1 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
|
||||
a1 a2 b
|
||||
a a b
|
||||
|
@ -1549,6 +1549,7 @@ c b a
|
|||
d b a
|
||||
select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
a1 a2 b c
|
||||
a b a i121
|
||||
select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
a1 a2 b
|
||||
explain select distinct a1,a2,b from t1;
|
||||
|
@ -1568,16 +1569,16 @@ id select_type table type possible_keys key key_len ref rows Extra
|
|||
1 SIMPLE t1 index NULL idx_t1_2 147 NULL 128 Using where; Using index
|
||||
explain select distinct a1,a2,b from t2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
|
||||
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL idx_t2_1 163 NULL 164 Using where; Using index
|
||||
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 index NULL idx_t2_2 146 NULL 164 Using where; Using index
|
||||
|
@ -1712,19 +1713,19 @@ 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 where; Using index for group-by; Using temporary; Using filesort
|
||||
explain select distinct a1,a2,b from t2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL 21 Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using index for group-by
|
||||
explain select distinct a1,a2,b from t2 where (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 t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range NULL idx_t2_1 163 NULL 21 Using where; Using index for group-by
|
||||
1 SIMPLE t2 index NULL idx_t2_1 163 NULL # Using where; Using index
|
||||
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL 16 Using where; Using index for group-by
|
||||
1 SIMPLE t2 range idx_t2_0,idx_t2_1,idx_t2_2 idx_t2_1 146 NULL # Using where; Using index for group-by
|
||||
explain select distinct b from t2 where (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 t2 range NULL idx_t2_1 146 NULL 21 Using where; Using index for group-by; Using temporary; Using filesort
|
||||
1 SIMPLE t2 range NULL idx_t2_1 146 NULL # Using where; Using index for group-by; Using temporary; Using filesort
|
||||
select distinct a1,a2,b from t1;
|
||||
a1 a2 b
|
||||
a a a
|
||||
|
@ -1787,6 +1788,7 @@ c b a
|
|||
d b a
|
||||
select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
a1 a2 b c
|
||||
a b a i121
|
||||
select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
a1 a2 b
|
||||
select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
||||
|
|
File diff suppressed because one or more lines are too long
|
@ -2781,8 +2781,6 @@ c1 c2
|
|||
2 NULL
|
||||
3 NULL
|
||||
DROP TABLE t1,t2,t3;
|
||||
drop table t1
|
||||
#;
|
||||
CREATE TABLE `t1` (
|
||||
`itemid` bigint(20) unsigned NOT NULL auto_increment,
|
||||
`sessionid` bigint(20) unsigned default NULL,
|
||||
|
|
|
@ -174,7 +174,7 @@ explain select a1, max(a2) from t1 group by a1;
|
|||
explain select a1, min(a2), max(a2) from t1 group by a1;
|
||||
explain select a1, a2, b, min(c), max(c) from t1 group by a1,a2,b;
|
||||
explain select a1,a2,b,max(c),min(c) from t1 group by a1,a2,b;
|
||||
--replace_column 7 #
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,max(c),min(c) from t2 group by a1,a2,b;
|
||||
-- Select fields in different order
|
||||
explain select min(a2), a1, max(a2), min(a2), a1 from t1 group by a1;
|
||||
|
@ -213,17 +213,29 @@ explain select a1,a2,b,min(c),max(c) from t1 where (a1 = 'b' or a1 = 'd' or a1 =
|
|||
explain select a1,min(c),max(c) from t1 where a1 >= 'b' group by a1,a2,b;
|
||||
explain select a1, max(c) from t1 where a1 in ('a','b','d') group by a1,a2,b;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where a1 < 'd' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 < 'd' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1, max(c) from t2 where a1 >= 'c' or a1 < 'b' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 >= 'c' or a2 < 'b' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where a1 = 'z' or a1 = 'b' or a1 = 'd' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,min(c),max(c) from t2 where a1 >= 'b' group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1, max(c) from t2 where a1 in ('a','b','d') group by a1,a2,b;
|
||||
|
||||
-- queries
|
||||
|
@ -306,6 +318,7 @@ select a1,a2,b,min(c),max(c) from t2 where b is NULL group by a1,a2;
|
|||
|
||||
-- C) Range predicates for the MIN/MAX attribute
|
||||
-- plans
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t1 where (c > 'b1') group by a1,a2,b;
|
||||
explain select a1,a2,b,min(c),max(c) from t1 where (c > 'b1') group by a1,a2,b;
|
||||
explain select a1,a2,b, max(c) from t1 where (c > 'f123') group by a1,a2,b;
|
||||
|
@ -323,20 +336,35 @@ explain select a1,a2,b,min(c),max(c) from t1 where (c < 'c5') or (c = 'g412') or
|
|||
explain select a1,a2,b,min(c),max(c) from t1 where ((c > 'b111') and (c <= 'g112')) or ((c > 'd000') and (c <= 'i110')) group by a1,a2,b;
|
||||
explain select a1,a2,b,min(c),max(c) from t1 where (c between 'b111' and 'g112') or (c between 'd000' and 'i110') group by a1,a2,b;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'b1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'f123') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'f123') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'a0') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'k321') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'k321') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'a0') or (c > 'b1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b, max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b1') or (c <= 'g1') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c > 'b111') and (c <= 'g112') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (c < 'c5') or (c = 'g412') or (c = 'k421') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain 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;
|
||||
|
||||
-- queries
|
||||
|
@ -394,11 +422,17 @@ explain select a1,a2,b,min(c) from t1 where ((a1 > 'a') or (a1 < '9')) and ((a2
|
|||
explain select a1,a2,b,min(c) from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
explain select a1,a2,b,min(c) from t1 where (ord(a1) > 97) and (ord(a2) + ord(a1) > 194) and (b = 'c') group by a1,a2,b;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a1 >= 'c' or a2 < 'b') and (c > 'b111') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c),max(c) from t2 where (a2 >= 'b') and (b = 'a') and (c > 'b111') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c < 'h112') or (c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122')) group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c) from t2 where ((a1 > 'a') or (a1 < '9')) and ((a2 >= 'b') and (a2 < 'z')) and (b = 'a') and ((c = 'j121') or (c > 'k121' and c < 'm122') or (c > 'o122') or (c < 'h112') or (c = 'c111')) group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,min(c) from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
|
||||
-- queries
|
||||
|
@ -428,9 +462,13 @@ explain select a1,a2,b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
|||
explain select a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
explain select a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b from t2 where (a1 >= 'c' or a2 < 'b') and (b > 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
|
||||
-- queries
|
||||
|
@ -456,9 +494,12 @@ explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c
|
|||
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
|
||||
explain select distinct b from t1 where (a2 >= 'b') and (b = 'a');
|
||||
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2;
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a');
|
||||
explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121');
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c');
|
||||
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a');
|
||||
|
||||
|
@ -496,10 +537,15 @@ explain select distinct a1,a2,b,c from t1 where (a2 >= 'b') and (b = 'a') and (c
|
|||
explain select distinct a1,a2,b from t1 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
explain select distinct b from t1 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
||||
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2;
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b,c from t2 where (a2 >= 'b') and (b = 'a') and (c = 'i121') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select distinct a1,a2,b from t2 where (a1 > 'a') and (a2 > 'a') and (b = 'c') group by a1,a2,b;
|
||||
--replace_column 9 #
|
||||
explain select distinct b from t2 where (a2 >= 'b') and (b = 'a') group by a1,a2,b;
|
||||
|
||||
-- queries
|
||||
|
|
|
@ -948,7 +948,7 @@ int write_record(THD *thd, TABLE *table,COPY_INFO *info)
|
|||
|
||||
err:
|
||||
if (key)
|
||||
my_safe_afree(key,table->max_unique_length,MAX_KEY_LENGTH);
|
||||
my_safe_afree(key,table->s->max_unique_length,MAX_KEY_LENGTH);
|
||||
info->last_errno= error;
|
||||
table->file->print_error(error,MYF(0));
|
||||
DBUG_RETURN(1);
|
||||
|
|
Loading…
Add table
Reference in a new issue