1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-09 22:24:09 +03:00

MDEV-12215: main.repair_symlink-5543 fails in buildbot

If openat is present on the system and it tries to open a symlink with
O_NOFOLLOW, we get errno 40.

If openat is not present on the system, we use the alternative open call, with
slightly different logic. IF the symlink doesn't point to a valid file,
we get errno 20. This test uses an invalid symlink on the table t1.MYD.
This commit is contained in:
Vicențiu Ciorbaru
2017-03-10 14:07:22 +02:00
parent 18de829618
commit 814d050760
2 changed files with 7 additions and 3 deletions

View File

@@ -1,9 +1,11 @@
create table t1 (a int) engine=myisam data directory='MYSQL_TMP_DIR';
insert t1 values (1);
# Some systems fail with errcode 40, when doing openat, while others
# don't have openat and fail with errcode 20.
repair table t1;
Table Op Msg_type Msg_text
test.t1 repair error 40 for record at pos 0
test.t1 repair Error File 'MYSQL_TMP_DIR/t1.MYD' not found (Errcode: 40 "Too many levels of symbolic links")
test.t1 repair error 20 for record at pos 0
test.t1 repair Error File 'MYSQL_TMP_DIR/t1.MYD' not found (Errcode: 20 "<errmsg>")
test.t1 repair status Operation failed
drop table t1;
create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR';

View File

@@ -9,7 +9,9 @@
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
--replace_regex / '.*\/t1/ 'MYSQL_TMP_DIR\/t1/
--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;