1
2"Ensure that we get an error if we exceed tmp_disk_table_size"
3
4SET @start_tmp_memory_table_size=@@session.tmp_memory_table_size;
5SET @start_tmp_disk_table_size=@@session.tmp_disk_table_size;
6set @@session.tmp_memory_table_size=1000;
7Warnings:
8Warning	1292	Truncated incorrect tmp_memory_table_size value: '1000'
9set @@session.tmp_disk_table_size=3000000;
10create table t1 (a int primary key, b varchar(2000));
11insert into t1 select seq,repeat(char(mod(seq,62)+64),seq) from seq_1_to_2000;
12insert into t1 values (20000,"A");
13select count(*) as c from t1 group by b having c>1;
14c
152
16show status like "created_tmp_disk%";
17Variable_name	Value
18Created_tmp_disk_tables	1
19set @@session.tmp_disk_table_size=1000000;
20select count(*) as c from t1 group by b having c>1;
21ERROR HY000: The table '(temporary)' is full
22show status like "created_tmp_disk%";
23Variable_name	Value
24Created_tmp_disk_tables	2
25drop table t1;
26