summaryrefslogtreecommitdiffstats
path: root/mysql-test/suite/innodb/t/skip_symbolic_links.test
diff options
context:
space:
mode:
Diffstat (limited to 'mysql-test/suite/innodb/t/skip_symbolic_links.test')
-rw-r--r--mysql-test/suite/innodb/t/skip_symbolic_links.test51
1 files changed, 51 insertions, 0 deletions
diff --git a/mysql-test/suite/innodb/t/skip_symbolic_links.test b/mysql-test/suite/innodb/t/skip_symbolic_links.test
new file mode 100644
index 00000000..b5274d22
--- /dev/null
+++ b/mysql-test/suite/innodb/t/skip_symbolic_links.test
@@ -0,0 +1,51 @@
+--source include/have_innodb.inc
+--source include/not_windows.inc
+
+SELECT @@have_symlink;
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval CREATE TABLE t1(a INT) ENGINE=InnoDB DATA DIRECTORY '$MYSQL_TMP_DIR';
+DROP TABLE t1;
+CREATE TABLE t1(a INT) ENGINE=InnoDB;
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval ALTER TABLE t1 DATA DIRECTORY '$MYSQL_TMP_DIR';
+SHOW CREATE TABLE t1;
+
+DROP TABLE t1;
+
+--let $restart_parameters=--symbolic-links
+--source include/restart_mysqld.inc
+
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval CREATE TABLE t1(a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+DATA DIRECTORY '$MYSQL_TMP_DIR';
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval CREATE TABLE t2(a INT PRIMARY KEY, b INT) ENGINE=InnoDB
+DATA DIRECTORY '$MYSQL_TMP_DIR';
+
+TRUNCATE TABLE t1;
+TRUNCATE TABLE t2;
+
+--let $restart_parameters=
+--source include/restart_mysqld.inc
+
+# Native ALTER will retain DATA DIRECTORY
+ALTER TABLE t1 FORCE, ALGORITHM=INPLACE;
+ALTER TABLE t2 FORCE, ALGORITHM=COPY;
+OPTIMIZE TABLE t1;
+--list_files $MYSQL_TMP_DIR/test
+DROP TABLE t2;
+
+RENAME TABLE t1 TO t2;
+ALTER TABLE t2 ADD UNIQUE INDEX(b), RENAME TO t3;
+
+ALTER TABLE t3 RENAME TO t2;
+ALTER TABLE t2 DROP INDEX b, RENAME TO t1;
+ALTER TABLE t1 CHANGE b c INT;
+ALTER TABLE t1 CHANGE c b INT NOT NULL;
+
+--list_files $MYSQL_TMP_DIR/test
+# TRUNCATE TABLE will discard DATA DIRECTORY.
+TRUNCATE TABLE t1;
+--list_files $MYSQL_TMP_DIR/test
+DROP TABLE t1;