|
| 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 | +--echo # Connection con1 |
| 17 | +connect (con1,localhost,root); |
| 18 | +show session variables like 'innodb_tmpdir'; |
| 19 | +alter table t1 add key(b); |
| 20 | +connection default; |
| 21 | +disconnect con1; |
| 22 | +drop table t1; |
| 23 | + |
| 24 | +--echo # innodb_tmpdir with invalid path. |
| 25 | + |
| 26 | +create table t1(a int primary key)engine=innodb; |
| 27 | +--error ER_WRONG_VALUE_FOR_VAR |
| 28 | +set global innodb_tmpdir='wrong_value'; |
| 29 | +show warnings; |
| 30 | +drop table t1; |
| 31 | + |
| 32 | + |
| 33 | +--echo # innodb_tmpdir with mysql data directory path. |
| 34 | + |
| 35 | +let $MYSQLD_DATADIR= `select @@datadir`; |
| 36 | +create table t1(a text, b text, fulltext(a,b))engine=innodb; |
| 37 | +insert into t1 values('test1', 'test2'); |
| 38 | +insert into t1 values('text1', 'text2'); |
| 39 | +--replace_result $MYSQLD_DATADIR MYSQL_DATADIR |
| 40 | +--error ER_WRONG_VALUE_FOR_VAR |
| 41 | +set global innodb_tmpdir = @@global.datadir; |
| 42 | +--replace_regex /.*mysqld.1*/DATADIR/ |
| 43 | +show warnings; |
| 44 | +drop table t1; |
| 45 | + |
| 46 | +--echo # innodb_tmpdir with valid location. |
| 47 | +let $MYSQL_TMP_DIR= `select @@tmpdir`; |
| 48 | +create table t1(a text, b text, fulltext(a,b))engine=innodb; |
| 49 | +insert into t1 values('test1', 'test2'); |
| 50 | +insert into t1 values('text1', 'text2'); |
| 51 | +set @tmpdir = @@global.tmpdir; |
| 52 | +set global innodb_tmpdir = @tmpdir; |
| 53 | +show session variables like 'innodb_tmpdir'; |
| 54 | +--echo # Connection con3 |
| 55 | +connect (con3,localhost,root); |
| 56 | +--replace_regex /.*mysqld.1/mysqld.1/ |
| 57 | +show session variables like 'innodb_tmpdir'; |
| 58 | +alter table t1 add fulltext(b); |
| 59 | +disconnect con3; |
| 60 | +connection default; |
| 61 | +set global innodb_tmpdir=NULL; |
| 62 | +drop table t1; |
| 63 | + |
| 64 | +--source include/wait_until_count_sessions.inc |
0 commit comments