From 814d0507604192d1da18eb2e30529e5559ce140e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Fri, 10 Mar 2017 14:07:22 +0200 Subject: [PATCH] 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. --- mysql-test/r/repair_symlink-5543.result | 6 ++++-- mysql-test/t/repair_symlink-5543.test | 4 +++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/mysql-test/r/repair_symlink-5543.result b/mysql-test/r/repair_symlink-5543.result index e827c7b7f73..f46e5833468 100644 --- a/mysql-test/r/repair_symlink-5543.result +++ b/mysql-test/r/repair_symlink-5543.result @@ -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 "") test.t1 repair status Operation failed drop table t1; create table t2 (a int) engine=aria data directory='MYSQL_TMP_DIR'; diff --git a/mysql-test/t/repair_symlink-5543.test b/mysql-test/t/repair_symlink-5543.test index b83c1aab1f6..8259ad82a51 100644 --- a/mysql-test/t/repair_symlink-5543.test +++ b/mysql-test/t/repair_symlink-5543.test @@ -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/ /".*"/""/ repair table t1; drop table t1;