Debian Codegraph @

mysql-test/suite/innodb/t/tmpdir.test

raw
1 --source include/count_sessions.inc
2
3 --echo #
4 --echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
5 --echo # WHERE INNODB WRITES TEMP FILES
6 --echo #
7
8 --echo # If innodb_tmpdir is NULL or "", temporary file will be created in
9 --echo # server configuration variable location(--tmpdir)
10
11 create table t1(a int primary key)engine=innodb;
12 show session variables like 'innodb_tmpdir';
13 alter table t1 add column b int not null;
14 set global innodb_tmpdir=NULL;
15 --echo # Connection con1
16 connect (con1,localhost,root);
17 show session variables like 'innodb_tmpdir';
18 alter table t1 add key(b);
19 connection default;
20 disconnect con1;
21 drop table t1;
22
23 --echo # innodb_tmpdir with invalid path.
24
25 create table t1(a int primary key)engine=innodb;
26 --error ER_WRONG_VALUE_FOR_VAR
27 set global innodb_tmpdir='wrong_value';
28 show warnings;
29 drop table t1;
30
31
32 --echo # innodb_tmpdir with mysql data directory path.
33
34 let $MYSQLD_DATADIR= `select @@datadir`;
35 create table t1(a text, b text, fulltext(a,b))engine=innodb;
36 insert into t1 values('test1', 'test2');
37 insert into t1 values('text1', 'text2');
38 --replace_result $MYSQLD_DATADIR MYSQL_DATADIR
39 --error ER_WRONG_VALUE_FOR_VAR
40 set global innodb_tmpdir = @@global.datadir;
41 --replace_regex /.*mysqld.1/DATADIR/
42 show warnings;
43 drop table t1;
44
45 --echo # innodb_tmpdir with valid location.
46 let $MYSQL_TMP_DIR= `select @@tmpdir`;
47 create table t1(a text, b text, fulltext(a,b))engine=innodb;
48 insert into t1 values('test1', 'test2');
49 insert into t1 values('text1', 'text2');
50 set @tmpdir = @@global.tmpdir;
51 set global innodb_tmpdir = @tmpdir;
52 show session variables like 'innodb_tmpdir';
53 --echo # Connection con3
54 connect (con3,localhost,root);
55 # Following alter uses innodb_tmpdir as a path to create temporary files
56 alter table t1 add fulltext(b);
57 disconnect con3;
58 connection default;
59 set global innodb_tmpdir=NULL;
60 drop table t1;
61
62 --source include/wait_until_count_sessions.inc