summaryrefslogtreecommitdiff
path: root/sql/sql_db.cc
diff options
context:
space:
mode:
authorMats Kindahl <mats@sun.com>2008-10-23 21:27:09 +0200
committerMats Kindahl <mats@sun.com>2008-10-23 21:27:09 +0200
commit32c161f3ea7314051090fb02eca03ef347394010 (patch)
tree09212d65be943c6c5dfd6d6a834841683d81f9f8 /sql/sql_db.cc
parent3be6d967c5d04fa6dbeab1c25f28673d3abf8433 (diff)
parente291aab7da9587f742291e7cc5e10e568846066e (diff)
downloadmariadb-git-32c161f3ea7314051090fb02eca03ef347394010.tar.gz
Merging 5.1 main into 5.1-rpl
Diffstat (limited to 'sql/sql_db.cc')
-rw-r--r--sql/sql_db.cc17
1 files changed, 13 insertions, 4 deletions
diff --git a/sql/sql_db.cc b/sql/sql_db.cc
index 00476e2fc38..4571ceba93f 100644
--- a/sql/sql_db.cc
+++ b/sql/sql_db.cc
@@ -37,7 +37,7 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp,
const char *db, const char *path, uint level,
TABLE_LIST **dropped_tables);
-static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
+long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path);
static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error);
static void mysql_change_db_impl(THD *thd,
LEX_STRING *new_db_name,
@@ -1095,7 +1095,11 @@ static long mysql_rm_known_files(THD *thd, MY_DIR *dirp, const char *db,
else if (file->name[0] == 'a' && file->name[1] == 'r' &&
file->name[2] == 'c' && file->name[3] == '\0')
{
- /* .frm archive */
+ /* .frm archive:
+ Those archives are obsolete, but following code should
+ exist to remove existent "arc" directories.
+ See #ifdef FRM_ARCHIVE directives for obsolete code.
+ */
char newpath[FN_REFLEN];
MY_DIR *new_dirp;
strxmov(newpath, org_path, "/", "arc", NullS);
@@ -1259,9 +1263,13 @@ static my_bool rm_dir_w_symlink(const char *org_path, my_bool send_error)
RETURN
> 0 number of removed files
-1 error
+
+ NOTE
+ A support of "arc" directories is obsolete, however this
+ function should exist to remove existent "arc" directories.
+ See #ifdef FRM_ARCHIVE directives for obsolete code.
*/
-static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp,
- const char *org_path)
+long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path)
{
long deleted= 0;
ulong found_other_files= 0;
@@ -1303,6 +1311,7 @@ static long mysql_rm_arc_files(THD *thd, MY_DIR *dirp,
{
goto err;
}
+ deleted++;
}
if (thd->killed)
goto err;