2
# Test of different EXPLAIN's
5
drop table if exists t1;
7
create TEMPORARY table t1 (id int not null, str char(10), unique(str)) ENGINE=MYISAM;
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
18
--error ER_KEY_DOES_NOT_EXITS
19
explain select * from t1 use key (str,str,foo) where str="foo";
20
--error ER_KEY_DOES_NOT_EXITS
21
explain select * from t1 ignore key (str,str,foo) where str="foo";
26
create TEMPORARY table t1 (a int not null) ENGINE=myisam;
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
37
create TEMPORARY table ☃ (☢ int, ☣ int, key ☢ (☢), key ☣ (☢,☣)) ENGINE=MYISAM;
38
insert into ☃ (☢) values (1);
39
insert into ☃ (☢) values (2);
40
explain select ☢ from ☃ where ☢=1;
47
# Bug#15463: EXPLAIN SELECT..INTO hangs the client (QB, command line)
50
explain select 3 into @v1;
53
# Bug #32241: memory corruption due to large index map in 'Range checked for
57
CREATE TABLE t1(c INT);
58
INSERT INTO t1 VALUES (),();
60
CREATE TABLE t2 (b INT,
61
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
62
KEY(b),KEY(b),KEY(b),KEY(b),KEY(b),
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));
70
INSERT INTO t2 VALUES (),(),();
72
# We only need to make sure that there is no buffer overrun and the index map
73
# is displayed correctly
74
--replace_column 1 X 2 X 3 X 4 X 5 X 6 X 7 X 8 X 9 X
76
(SELECT 1 FROM t2,t1 WHERE b < c GROUP BY 1 LIMIT 1) AS d2;
80
--echo End of 5.0 tests.
86
--echo End of 5.2 tests.