1drop table if exists t0,t1;
2create table t0 (a int);
3insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
4explain select * from t0 where a < 3;
5id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
61	SIMPLE	t0	ALL	NULL	NULL	NULL	NULL	10	Using where
7#
8# MDEV-5045: Server crashes in QPF_query::print_explain with log_slow_verbosity='query_plan,explain'
9#
10set autocommit=1;
11drop table t0;
12#
13# MDEV-5047 virtual THD::~THD(): Assertion `status_var.memory_used == 0' fails on disconnect
14#
15connect  con1,localhost,root,,;
16ALTER TABLE nonexisting ENABLE KEYS;
17ERROR 42S02: Table 'test.nonexisting' doesn't exist
18SHOW WARNINGS;
19Level	Code	Message
20Error	1146	Table 'test.nonexisting' doesn't exist
21disconnect con1;
22connection default;
23SELECT 1;
241
251
26#
27# MDEV-5060 Server crashes on EXPLAIN EXTENDED or EXPLAIN PARTITIONS with explain in slow_log
28#
29EXPLAIN PARTITIONS SELECT 1 ;
30id	select_type	table	partitions	type	possible_keys	key	key_len	ref	rows	Extra
311	SIMPLE	NULL	NULL	NULL	NULL	NULL	NULL	NULL	NULL	No tables used
32#
33# MDEV-5106: Server crashes in Explain_union::print_explain on ER_TOO_BIG_SELECT with explain in slow log
34#
35CREATE TABLE t1 (i INT) ENGINE=MyISAM;
36INSERT INTO t1 VALUES
37(1),(2),(3),(4),(5),(6),(7),(8),(9),(10);
38SET max_join_size = 10;
39( SELECT ta.* FROM t1 ta, t1 tb ) UNION ( SELECT * FROM t1 );
40ERROR 42000: The SELECT would examine more than MAX_JOIN_SIZE rows; check your WHERE and use SET SQL_BIG_SELECTS=1 or SET MAX_JOIN_SIZE=# if the SELECT is okay
41SELECT 'Server still alive?' as 'Yes';
42Yes
43Server still alive?
44DROP TABLE t1;
45#
46# MDEV-5308 Crash when running with slow_query_log=1
47#
48SET @save1= @@log_slow_rate_limit;
49SET @save2= @@long_query_time;
50SET log_slow_rate_limit=1000;
51SET long_query_time=0.000001;
52SELECT 1;
531
541
55SET log_slow_rate_limit=@save1;
56SET long_query_time=@save2;
57create table t1 (a int);
58execute immediate "select * from t1 join t1 t2 on (t1.a>5) where exists (select 1)";
59a	a
60drop table t1;
61