summaryrefslogtreecommitdiff
path: root/mysql-test/t/symlink.test
diff options
context:
space:
mode:
authorSergey Vojtovich <svoj@sun.com>2010-04-01 18:49:02 +0400
committerSergey Vojtovich <svoj@sun.com>2010-04-01 18:49:02 +0400
commitab1242b9e30c34e50f28146d2ff9953ec40749ee (patch)
tree890b3635bd4f971409a5a17fb8571d2944435d2c /mysql-test/t/symlink.test
parent454c003a5c5a31a8d59ba4ab54d3b3a90a609752 (diff)
downloadmariadb-git-ab1242b9e30c34e50f28146d2ff9953ec40749ee.tar.gz
BUG#40980 - Drop table can remove another MyISAM table's
data and index files It was possible if DATA/INDEX DIRECTORY is pointing to symlinked MySQL data home directory. Do not allow to drop data/index files implicitly symlinked to data home directory. For such tables remove symlink only. mysql-test/r/symlink.result: A test case for BUG#40980. mysql-test/t/symlink.test: A test case for BUG#40980. storage/myisam/mi_delete_table.c: Do not allow to drop data/index files implicitly symlinked to data home directory. For such tables remove symlink only.
Diffstat (limited to 'mysql-test/t/symlink.test')
-rw-r--r--mysql-test/t/symlink.test22
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/t/symlink.test b/mysql-test/t/symlink.test
index c805dd40fe8..073fcd28246 100644
--- a/mysql-test/t/symlink.test
+++ b/mysql-test/t/symlink.test
@@ -249,4 +249,26 @@ eval CREATE TABLE t1(a INT) DATA DIRECTORY='$MYSQLTEST_VARDIR/tmp' INDEX DIRECTO
DROP TABLE t1;
SET @@SQL_MODE=@OLD_SQL_MODE;
+--echo #
+--echo # BUG#40980 - Drop table can remove another MyISAM table's
+--echo # data and index files
+--echo #
+--mkdir $MYSQL_TMP_DIR/mysql
+--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
+eval CREATE TABLE user(a INT) DATA DIRECTORY='$MYSQL_TMP_DIR/mysql'
+ INDEX DIRECTORY='$MYSQL_TMP_DIR/mysql';
+FLUSH TABLE user;
+--echo # Symlinking mysql database to tmpdir
+--remove_file $MYSQL_TMP_DIR/mysql/user.MYD
+--remove_file $MYSQL_TMP_DIR/mysql/user.MYI
+--rmdir $MYSQL_TMP_DIR/mysql
+--exec ln -s $MYSQLD_DATADIR/mysql $MYSQL_TMP_DIR/mysql
+FLUSH TABLE mysql.user;
+DROP TABLE user;
+FLUSH TABLE mysql.user;
+--disable_result_log
+SELECT * FROM mysql.user;
+--enable_result_log
+--remove_file $MYSQL_TMP_DIR/mysql
+
--echo End of 5.1 tests