Debian Codegraph @

mysql-test/suite/storage_engine/tbl_opt_index_dir.test

raw
1 #
2 # Check whether INDEX DIRECTORY is supported in CREATE and ALTER TABLE
3 #
4 # Note: the test does not check whether the option
5 # has any real effect on the table, only that it is accepted
6 #
7
8 --source include/have_symlink.inc
9 --source have_engine.inc
10
11 --let $index_dir1 = $MYSQLTEST_VARDIR/storage_engine_index_dir1/
12 --let $index_dir2 = $MYSQLTEST_VARDIR/storage_engine_index_dir2/
13 --mkdir $index_dir1
14 --mkdir $index_dir2
15
16 --disable_warnings
17 DROP TABLE IF EXISTS t1;
18 --enable_warnings
19
20 --let $table_options = INDEX DIRECTORY = '$index_dir1'
21 # We cannot mask the folder name here and further, but we can switch off query logging
22 --let $disable_query_log = 1
23 --echo # Running CREATE TABLE .. INDEX DIRECTORY = <>
24 --source create_table.inc
25
26 --source mask_engine.inc
27 --replace_result $index_dir1 <INDEX_DIR_1>
28 SHOW CREATE TABLE t1;
29
30 --echo # For ALTER TABLE the option is ignored
31
32 --let $alter_definition = INDEX DIRECTORY = '$index_dir2'
33 --disable_query_log
34 --echo # Running ALTER TABLE .. INDEX DIRECTORY = <>
35 --source alter_table.inc
36 if ($mysql_errname)
37 {
38 --let $my_last_stmt = $alter_statement
39 --let $functionality = ALTER TABLE
40 --source unexpected_result.inc
41 }
42 --enable_query_log
43 --source mask_engine.inc
44 --replace_result $index_dir1 <INDEX_DIR_1>
45 SHOW CREATE TABLE t1;
46
47 DROP TABLE t1;
48
49 --source cleanup_engine.inc
50
51 --rmdir $index_dir1
52 --rmdir $index_dir2