Debian Codegraph @

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

raw
1 --source include/have_innodb.inc
2 --source include/count_sessions.inc
3
4 --echo #
5 --echo # Bug #19183565 CREATE DYNAMIC INNODB_TMPDIR VARIABLE TO CONTROL
6 --echo # WHERE INNODB WRITES TEMP FILES
7 --echo #
8
9 --echo # If innodb_tmpdir is NULL or "", temporary file will be created in
10 --echo # server configuration variable location(--tmpdir)
11
12 create table t1(a int primary key)engine=innodb;
13 show session variables like 'innodb_tmpdir';
14 alter table t1 add column b int not null;
15 set global innodb_tmpdir=NULL;
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 connect (con3,localhost,root);
54 # Following alter using innodb_tmpdir as a path to create temporary files
55 alter table t1 add fulltext(b);
56 disconnect con3;
57 connection default;
58 set global innodb_tmpdir=NULL;
59 drop table t1;
60
61 --source include/wait_until_count_sessions.inc