1#
2# MDEV-6181 EITS could eat all tmpdir space and hang
3#
4# test that ANALYZE TABLE is immediately aborted when going out of disk space
5--source include/have_debug.inc
6
7call mtr.add_suppression("No space left on device");
8create table t1 (a varchar(255), b varchar(255), c varchar(255));
9--disable_query_log
10let $i=10000;
11while ($i) {
12  insert t1 values (repeat(format(rand(),10), 20),
13                    repeat(format(rand(),10), 20),
14                    repeat(format(rand(),10), 20));
15  dec $i;
16}
17--enable_query_log
18set use_stat_tables=PREFERABLY, optimizer_use_condition_selectivity=3;
19SET @saved_dbug = @@SESSION.debug_dbug;
20SET debug_dbug='+d,simulate_file_write_error';
21set @@max_heap_table_size=128*1024;
22--replace_regex /'.*'/'tmp-file'/
23analyze table t1;
24SET debug_dbug= @saved_dbug;
25drop table t1;
26