summaryrefslogtreecommitdiff
path: root/mysql-test/suite/storage_engine/tbl_opt_data_index_dir.test
blob: 4a83cc46b84ca815e8dfb5f211c2d667d8192716 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# 
# Check whether DATA DIRECTORY and INDEX DIRECTORY
# are supported in CREATE and ALTER TABLE
#
# Note: the test does not check whether the options
#       have any real effect on the table, only 
#       that they are accepted
# 

--source include/have_symlink.inc
--source have_engine.inc

--let $data_dir = $MYSQLTEST_VARDIR/storage_engine_data_dir/
--let $index_dir = $MYSQLTEST_VARDIR/storage_engine_index_dir/
--mkdir $data_dir
--mkdir $index_dir

--disable_warnings
DROP TABLE IF EXISTS t1;
--enable_warnings

--let $table_options = DATA DIRECTORY = '$data_dir' INDEX DIRECTORY = '$index_dir'
# We cannot mask the folders name here, but we can switch off query logging
--let $disable_query_log = 1
--source create_table.inc

--source mask_engine.inc
--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR>
SHOW CREATE TABLE t1;

--let $alter_definition = INDEX DIRECTORY = '$data_dir'
--disable_query_log
--source alter_table.inc
if ($mysql_errname)
{
  --let $my_last_stmt = $alter_statement
  --let $functionality = ALTER TABLE
  --source unexpected_result.inc
}
--enable_query_log
--source mask_engine.inc
--replace_result $data_dir <DATA_DIR> $index_dir <INDEX_DIR> 
SHOW CREATE TABLE t1;

DROP TABLE t1;

--source cleanup_engine.inc

--rmdir $data_dir
--rmdir $index_dir