mariadb/mysql-test/main/repair_symlink-5543.test
Sergei Golubchik 531935992a test fixes for FreeBSD
* FreeBSD returns errno 31 (EMLINK, Too many links),
  not 40 (ELOOP, Too many levels of symbolic links)
* (`mysqlbinlog|mysql`) was just crazy, why did it ever work?
* socket_ipv6.inc check (that checked whether ipv6 is supported)
  only worked correctly when ipv6 was supported
* perfschema.socket_summary_by_instance was changing global variables
  and then skip-ing the test (because on missing ipv6)
2022-05-04 19:34:20 +02:00

27 lines
989 B
Text

#
# 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 31 (FreeBSD), 40, or 90 (MIPS) when doing openat,
--echo # while others don't have openat and fail with errcode 20.
--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/ /[49]0|31/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/ /[49]0|31/20/ /".*"/"<errmsg>"/
repair table t2;
drop table t2;
--list_files $MYSQL_TMP_DIR foobar5543