summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc7
1 files changed, 6 insertions, 1 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index a6bd1955fa5..bddaebdc0f2 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -462,7 +462,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
tot_list_next= &tot_list;
- for (uint idx=2 ;
+ for (uint idx=0 ;
idx < (uint) dirp->number_off_files && !thd->killed ;
idx++)
{
@@ -470,6 +470,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
char *extension;
DBUG_PRINT("info",("Examining: %s", file->name));
+ /* skiping . and .. */
+ if (file->name[0] == '.' && (!file->name[1] ||
+ (file->name[1] == '.' && !file->name[2])))
+ continue;
+
/* Check if file is a raid directory */
if ((my_isdigit(&my_charset_latin1, file->name[0]) ||
(file->name[0] >= 'a' && file->name[0] <= 'f')) &&