summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <gluh@eagle.intranet.mysql.r18.ru>2006-01-24 15:59:08 +0400
committerunknown <gluh@eagle.intranet.mysql.r18.ru>2006-01-24 15:59:08 +0400
commitfbc24f3376a6eb7e119af9fa6c32ca797ce1c5c0 (patch)
tree26fbb68766c042b22a44a8c08ca1364dad639749
parent03ad365b00c446a6da418cb9112448449f2e5a45 (diff)
downloadmariadb-git-fbc24f3376a6eb7e119af9fa6c32ca797ce1c5c0.tar.gz
Fix for bug#15851 Unlistable directories yield no info from information_schema
to skip directories which are not allowed for read mysql-test/r/information_schema.result: Fix for bug#15851 Unlistable directories yield no info from information_schema test result mysql-test/t/information_schema.test: Fix for bug#15851 Unlistable directories yield no info from information_schema test case
-rw-r--r--mysql-test/r/information_schema.result5
-rw-r--r--mysql-test/t/information_schema.test10
-rw-r--r--mysys/my_lib.c2
3 files changed, 17 insertions, 0 deletions
diff --git a/mysql-test/r/information_schema.result b/mysql-test/r/information_schema.result
index e7d82f48691..074b68881af 100644
--- a/mysql-test/r/information_schema.result
+++ b/mysql-test/r/information_schema.result
@@ -1084,3 +1084,8 @@ DROP TABLE t1;
DROP VIEW v1;
DROP FUNCTION func1;
DROP FUNCTION func2;
+create database mysqltest;
+create table mysqltest.t1(a int);
+select table_schema from information_schema.tables where table_schema='mysqltest';
+table_schema
+drop database mysqltest;
diff --git a/mysql-test/t/information_schema.test b/mysql-test/t/information_schema.test
index f835a7148a2..323c6b37059 100644
--- a/mysql-test/t/information_schema.test
+++ b/mysql-test/t/information_schema.test
@@ -790,3 +790,13 @@ DROP TABLE t1;
DROP VIEW v1;
DROP FUNCTION func1;
DROP FUNCTION func2;
+
+#
+# Bug #15851 Unlistable directories yield no info from information_schema
+#
+create database mysqltest;
+create table mysqltest.t1(a int);
+--exec chmod -r $MYSQL_TEST_DIR/var/master-data/mysqltest
+select table_schema from information_schema.tables where table_schema='mysqltest';
+--exec chmod +r $MYSQL_TEST_DIR/var/master-data/mysqltest
+drop database mysqltest;
diff --git a/mysys/my_lib.c b/mysys/my_lib.c
index 1908c70f407..4ca343064d3 100644
--- a/mysys/my_lib.c
+++ b/mysys/my_lib.c
@@ -170,6 +170,8 @@ MY_DIR *my_dir(const char *path, myf MyFlags)
bzero(finfo.mystat, sizeof(MY_STAT));
VOID(strmov(tmp_file,dp->d_name));
VOID(my_stat(tmp_path, finfo.mystat, MyFlags));
+ if (!(finfo.mystat->st_mode & MY_S_IREAD))
+ continue;
}
else
finfo.mystat= NULL;