
"Ensure that we get an error if we exceed tmp_disk_table_size"

SET @start_tmp_memory_table_size=@@session.tmp_memory_table_size;
SET @start_tmp_disk_table_size=@@session.tmp_disk_table_size;
set @@session.tmp_memory_table_size=16384;
set @@session.tmp_disk_table_size=3000000;
create table t1 (a int primary key, b varchar(2000));
insert into t1 select seq,repeat(char(mod(seq,62)+64),seq) from seq_1_to_2000;
insert into t1 values (20000,"A");
select count(*) as c from t1 group by b having c>1;
c
2
show status like "created_tmp_disk%";
Variable_name	Value
Created_tmp_disk_tables	1
set @@session.tmp_disk_table_size=1000000;
select count(*) as c from t1 group by b having c>1;
ERROR HY000: The table '(temporary)' is full
show status like "created_tmp_disk%";
Variable_name	Value
Created_tmp_disk_tables	2
drop table t1;
