mirror of
https://github.com/MariaDB/server.git
synced 2025-07-29 05:21:33 +03:00
Fixed bug #5500: EXPLAIN returned a wrong select_type for queries using views.
Select_type in the EXPLAIN output for the query SELECT * FROM t1 was 'SIMPLE', while for the query SELECT * FROM v1, where the view v1 was defined as SELECT * FROM t1, the EXPLAIN output contained 'PRIMARY' for the select_type column.
This commit is contained in:
@ -750,13 +750,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
EXPLAIN SELECT a,b FROM v1 WHERE a < 2 and b=3;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
EXPLAIN SELECT a,b FROM t1 WHERE a < 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
EXPLAIN SELECT a,b FROM v1 WHERE a < 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 4 Using where; Using index
|
||||
SELECT a,b FROM t1 WHERE a < 2 and b=3;
|
||||
a b
|
||||
1 3
|
||||
@ -799,13 +799,13 @@ id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
explain select * from v1 where a in (3,4) and b in (1,2,3);
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
explain select * from t1 where a between 3 and 4 and b between 1 and 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
explain select * from v1 where a between 3 and 4 and b between 1 and 2;
|
||||
id select_type table type possible_keys key key_len ref rows Extra
|
||||
1 PRIMARY t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
1 SIMPLE t1 range PRIMARY PRIMARY 8 NULL # Using where; Using index
|
||||
drop view v1;
|
||||
drop table t1;
|
||||
create table t3 (a int);
|
||||
|
Reference in New Issue
Block a user