155
155
id select_type table type possible_keys key key_len ref rows Extra
156
156
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
157
157
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
158
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
159
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
158
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
159
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
160
160
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
161
161
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
163
163
id select_type table type possible_keys key key_len ref rows Extra
164
164
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
165
165
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
166
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
167
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
166
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
167
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
168
168
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
169
169
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
170
170
explain SELECT (SELECT SUM(c1 + c12 + 0.0) FROM t2 where (t1.c2 - 0e-3) = t2.c2 GROUP BY t1.c15 LIMIT 1) as scalar_s, exists (select 1.0e+0 from t2 where t2.c3 * 9.0000000000 = t1.c4) as exists_s, c5 * 4 in (select c6 + 0.3e+1 from t2) as in_s, (c7 - 4, c8 - 4) in (select c9 + 4.0, c10 + 40e-1 from t2) as in_row_s FROM t1, (select c25 x, c32 y from t2) tt WHERE x * 1 = c25;
171
171
id select_type table type possible_keys key key_len ref rows Extra
172
172
1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
173
173
6 DERIVED NULL NULL NULL NULL NULL NULL NULL no matching row in const table
174
5 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
175
4 DEPENDENT SUBQUERY t2 system NULL NULL NULL NULL 0 const row not found
174
5 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
175
4 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
176
176
3 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
177
177
2 DEPENDENT SUBQUERY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables
178
178
deallocate prepare stmt1;
1787
1787
show create view v1;
1788
1788
View Create View character_set_client collation_connection
1789
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) AS `a+2` from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` AS `a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
1789
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
1790
1790
select * from v1;
1794
1794
deallocate prepare stmt;
1795
1795
show create view v1;
1796
1796
View Create View character_set_client collation_connection
1797
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) AS `a+2` from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` AS `a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
1797
v1 CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `v1` AS select `t1`.`a` AS `c`,`t1`.`b` AS `d`,`t1`.`a` in (select (`t1`.`a` + 2) from `t1`) AS `e`,`t1`.`a` = all (select `t1`.`a` from `t1`) AS `f` from `t1` latin1 latin1_swedish_ci
1798
1798
select * from v1;
1918
1918
-12345.5432100000
1919
1919
deallocate prepare stmt;
1921
# Bug#48508: Crash on prepared statement re-execution.
1923
create table t1(b int);
1924
insert into t1 values (0);
1925
create view v1 AS select 1 as a from t1 where b;
1926
prepare stmt from "select * from v1 where a";
1931
deallocate prepare stmt;
1934
create table t1(a bigint);
1935
create table t2(b tinyint);
1936
insert into t2 values (null);
1937
prepare stmt from "select 1 from t1 join t2 on a xor b where b > 1 and a =1";
1942
deallocate prepare stmt;
1946
# Bug #49570: Assertion failed: !(order->used & map)
1947
# on re-execution of prepared statement
1949
CREATE TABLE t1(a INT PRIMARY KEY);
1950
INSERT INTO t1 VALUES(0), (1);
1952
"SELECT 1 FROM t1 JOIN t1 t2 USING(a) GROUP BY t2.a, t1.a";
1965
DEALLOCATE PREPARE stmt;
1920
1967
End of 5.0 tests.
1921
1968
create procedure proc_1() reset query cache;
2922
2969
Db Name Definer Time zone Type Execute at Interval value Interval field Starts Ends Status Originator character_set_client collation_connection Database Collation
2924
2971
deallocate prepare stmt;
2973
# Bug#49141: Encode function is significantly slower in 5.1 compared to 5.0
2975
prepare encode from "select encode(?, ?) into @ciphertext";
2976
prepare decode from "select decode(?, ?) into @plaintext";
2977
set @str="abc", @key="cba";
2978
execute encode using @str, @key;
2979
execute decode using @ciphertext, @key;
2983
set @str="bcd", @key="dcb";
2984
execute encode using @str, @key;
2985
execute decode using @ciphertext, @key;
2989
deallocate prepare encode;
2990
deallocate prepare decode;
2992
# Bug#52124 memory leaks like a sieve in datetime, timestamp, time, date fields + warnings
2994
CREATE TABLE t1 (a DATETIME NOT NULL, b TINYINT);
2995
INSERT INTO t1 VALUES (0, 0),(0, 0);
2996
PREPARE stmt FROM "SELECT 1 FROM t1 WHERE
2997
ROW(a, b) >= ROW('1', (SELECT 1 FROM t1 WHERE a > 1234))";
3002
DEALLOCATE PREPARE stmt;
3005
# Bug#54494 crash with explain extended and prepared statements
3007
CREATE TABLE t1(a INT);
3008
INSERT INTO t1 VALUES (1),(2);
3009
PREPARE stmt FROM 'EXPLAIN EXTENDED SELECT 1 FROM t1 RIGHT JOIN t1 t2 ON 1';
3011
id select_type table type possible_keys key key_len ref rows filtered Extra
3012
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
3013
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
3015
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
3017
id select_type table type possible_keys key key_len ref rows filtered Extra
3018
1 SIMPLE t2 ALL NULL NULL NULL NULL 2 100.00
3019
1 SIMPLE t1 ALL NULL NULL NULL NULL 2 100.00
3021
Note 1003 select 1 AS `1` from `test`.`t1` `t2` left join `test`.`t1` on(1) where 1
3022
DEALLOCATE PREPARE stmt;
3025
# Bug#54488 crash when using explain and prepared statements with subqueries
3027
CREATE TABLE t1(f1 INT);
3028
INSERT INTO t1 VALUES (1),(1);
3029
PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE (SELECT (SELECT 1 FROM t1 GROUP BY f1))';
3031
id select_type table type possible_keys key key_len ref rows Extra
3032
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
3033
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3034
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
3036
id select_type table type possible_keys key key_len ref rows Extra
3037
1 PRIMARY t1 ALL NULL NULL NULL NULL 2
3038
2 SUBQUERY NULL NULL NULL NULL NULL NULL NULL No tables used
3039
3 SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using temporary; Using filesort
3040
DEALLOCATE PREPARE stmt;
2925
3042
End of 5.1 tests.