From 06f1f1aa6e3dbc1efcd623378fe415b27c32b944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vicen=C8=9Biu=20Ciorbaru?= Date: Tue, 14 Mar 2017 00:24:06 +0200 Subject: [PATCH] Make ELOOP be considered a File Not Found error when it comes from handlerton Fix symlink-aria && symlink-myisam to account for this possibility. --- mysql-test/r/symlink-aria-11902.result | 4 ++-- mysql-test/r/symlink-myisam-11902.result | 4 ++-- mysql-test/t/symlink-myisam-11902.test | 4 ++-- sql/handler.cc | 1 + 4 files changed, 7 insertions(+), 6 deletions(-) diff --git a/mysql-test/r/symlink-aria-11902.result b/mysql-test/r/symlink-aria-11902.result index 66405b1c25f..e563780b3ec 100644 --- a/mysql-test/r/symlink-aria-11902.result +++ b/mysql-test/r/symlink-aria-11902.result @@ -14,7 +14,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; select * from t1; set debug_sync='now WAIT_FOR ok'; set debug_sync='now SIGNAL go'; -ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MAD' not found (Errcode: 20 "Not a directory") +ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MAD' not found (Errcode: 20 ) flush tables; drop table if exists t1; create table t1 (a int, b char(16), index (a)) @@ -32,7 +32,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; select a from t1; set debug_sync='now WAIT_FOR waiting'; set debug_sync='now SIGNAL run'; -ERROR HY000: Can't find file: './test/t1.MAI' (errno: 20 "Not a directory") +ERROR HY000: Can't find file: './test/t1.MAI' (errno: 20 ) flush tables; drop table if exists t1; drop table mysql.t1; diff --git a/mysql-test/r/symlink-myisam-11902.result b/mysql-test/r/symlink-myisam-11902.result index 4b07aa3f4a7..33357a80700 100644 --- a/mysql-test/r/symlink-myisam-11902.result +++ b/mysql-test/r/symlink-myisam-11902.result @@ -13,7 +13,7 @@ set debug_sync='mi_open_datafile SIGNAL ok WAIT_FOR go'; select * from t1; set debug_sync='now WAIT_FOR ok'; set debug_sync='now SIGNAL go'; -ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MYD' not found (Errcode: 20 "Not a directory") +ERROR HY000: File 'MYSQLTEST_VARDIR/tmp/foo/t1.MYD' not found (Errcode: 20 ) flush tables; drop table if exists t1; create table t1 (a int, b char(16), index (a)) @@ -31,7 +31,7 @@ set debug_sync='mi_open_kfile SIGNAL waiting WAIT_FOR run'; select a from t1; set debug_sync='now WAIT_FOR waiting'; set debug_sync='now SIGNAL run'; -ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 "Not a directory") +ERROR HY000: Can't find file: './test/t1.MYI' (errno: 20 ) flush tables; drop table if exists t1; drop table mysql.t1; diff --git a/mysql-test/t/symlink-myisam-11902.test b/mysql-test/t/symlink-myisam-11902.test index 426f8e61edc..8fd4961d1fb 100644 --- a/mysql-test/t/symlink-myisam-11902.test +++ b/mysql-test/t/symlink-myisam-11902.test @@ -25,7 +25,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo; exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; set debug_sync='now SIGNAL go'; connection default; -replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/; +replace_regex / '.*\/tmp\// 'MYSQLTEST_VARDIR\/tmp\// /31/20/ /40/20/ /20.*/20 )/; error 29; reap; flush tables; @@ -49,7 +49,7 @@ exec rm -r $MYSQLTEST_VARDIR/tmp/foo; exec ln -s $datadir/mysql $MYSQLTEST_VARDIR/tmp/foo; set debug_sync='now SIGNAL run'; connection default; -replace_regex / '.*\/test\// '.\/test\// /31/20/; +replace_regex / '.*\/test\// '.\/test\// /31/20/ /40/20/ /20.*/20 )/; error ER_FILE_NOT_FOUND; reap; flush tables; diff --git a/sql/handler.cc b/sql/handler.cc index 8b0f885bb63..7fa8afdb253 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3372,6 +3372,7 @@ void handler::print_error(int error, myf errflag) break; case ENOENT: case ENOTDIR: + case ELOOP: textno=ER_FILE_NOT_FOUND; break; case ENOSPC: