summaryrefslogtreecommitdiff
path: root/mysql-test/main/repair_symlink-5543.test
blob: 4c120334d056793509c88bb5550cc3d64a886619 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#
# MDEV-5543 MyISAM repair unsafe usage of TMD files 
#
--source include/have_symlink.inc
--source include/not_windows.inc
--source include/have_maria.inc

--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval create table t1 (a int) engine=myisam data directory='$MYSQL_TMP_DIR';
insert t1 values (1);
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t1.TMD
--echo # Some systems fail with errcode 40, when doing openat, while others
--echo # don't have openat and fail with errcode 20.
--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /40/20/ /".*"/"<errmsg>"/
repair table t1;
drop table t1;

--replace_result $MYSQL_TMP_DIR MYSQL_TMP_DIR
eval create table t2 (a int) engine=aria data directory='$MYSQL_TMP_DIR';
insert t2 values (1);
--system ln -s $MYSQL_TMP_DIR/foobar5543 $MYSQL_TMP_DIR/t2.TMD
--replace_regex / '.*\/t2/ 'MYSQL_TMP_DIR\/t2/ /40/20/ /".*"/"<errmsg>"/
repair table t2;
drop table t2;

--list_files $MYSQL_TMP_DIR foobar5543