mariadb/mysql-test/suite/innodb/t/skip_symbolic_links.test
Marko Mäkelä c1d7b4575e MDEV-26870 --skip-symbolic-links does not disallow .isl file creation
The InnoDB DATA DIRECTORY attribute is not implemented via
symbolic links but something similar, *.isl files that contain
the names of data files.

InnoDB failed to ignore the DATA DIRECTORY attribute even though
the server was started with --skip-symbolic-links.

Native ALTER TABLE in InnoDB will retain the DATA DIRECTORY attribute
of the table, no matter if the table will be rebuilt or not.

Generic ALTER TABLE (with ALGORITHM=COPY) as well as TRUNCATE TABLE
will discard the DATA DIRECTORY attribute.

All tests have been run with and without the ./mtr option
--mysqld=--skip-symbolic-links
and some tests that use the InnoDB DATA DIRECTORY attribute
have been adjusted for this.
2022-01-21 14:43:59 +02:00

51 lines
1.4 KiB
Text

--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;