2
# Test of different EXPLAIN's
5
drop table if exists t1;
7
create table t1 (id int not null, str char(10), unique(str));
8
explain select * from t1;
9
insert into t1 values (1, null),(2, null),(3, "foo"),(4, "bar");
10
select * from t1 where str is null;
11
select * from t1 where str="foo";
12
explain select * from t1 where str is null;
13
explain select * from t1 where str="foo";
14
explain select * from t1 ignore key (str) where str="foo";
15
explain select * from t1 use key (str,str) where str="foo";
17
#The following should give errors
19
explain select * from t1 use key (str,str,foo) where str="foo";
21
explain select * from t1 ignore key (str,str,foo) where str="foo";
26
create table t1 (a int not null);
27
explain select count(*) from t1;
28
insert into t1 values(1);
29
explain select count(*) from t1;
30
insert into t1 values(1);
31
explain select count(*) from t1;
35
# Bug #3403 Wrong encoding in EXPLAIN SELECT output
38
create table ��� (���0 int, ���1 int, key ���0 (���0), key ���01 (���0,���1));
39
insert into ��� (���0) values (1);
40
insert into ��� (���0) values (2);
41
explain select ���0 from ��� where ���0=1;
49
# Bug#15463: EXPLAIN SELECT..INTO hangs the client (QB, command line)
52
explain select 3 into @v1;
55
# Bug #32241: memory corruption due to large index map in 'Range checked for
59
CREATE TABLE t1(c INT);
60
INSERT INTO t1 VALUES (),();
62
CREATE TABLE t2 (b INT,
63
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
64
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
65
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
66
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
67
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
68
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
69
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
70
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b));
72
INSERT INTO t2 VALUES (),(),();
74
# We only need to make sure that there is no buffer overrun and the index map
75
# is displayed correctly
76
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X
78
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
82
--echo End of 5.0 tests.
88
--echo End of 5.2 tests.