Debian Codegraph @

mysql-test/suite/storage_engine/tbl_opt_data_dir.test

raw
1 #
2 # Check whether DATA 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 $data_dir1 = $MYSQLTEST_VARDIR/storage_engine_data_dir1/
12 --let $data_dir2 = $MYSQLTEST_VARDIR/storage_engine_data_dir2/
13 --mkdir $data_dir1
14 --mkdir $data_dir2
15
16 --disable_warnings
17 DROP TABLE IF EXISTS t1;
18 --enable_warnings
19
20 --let $table_options = DATA DIRECTORY = '$data_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 .. DATA DIRECTORY = <>
24 --source create_table.inc
25
26 --source mask_engine.inc
27 --replace_result $data_dir1 <DATA_DIR_1>
28 SHOW CREATE TABLE t1;
29
30 --echo # For ALTER TABLE the option is ignored
31
32 --let $alter_definition = DATA DIRECTORY = '$data_dir2'
33 --disable_query_log
34 --echo # Running ALTER TABLE .. DATA 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 $data_dir1 <DATA_DIR_1>
45 SHOW CREATE TABLE t1;
46
47 DROP TABLE t1;
48
49 --source cleanup_engine.inc
50
51 --rmdir $data_dir1
52 --rmdir $data_dir2