diff options
author | Gleb Shchepa <gshchepa@mysql.com> | 2008-09-30 18:16:11 +0500 |
---|---|---|
committer | Gleb Shchepa <gshchepa@mysql.com> | 2008-09-30 18:16:11 +0500 |
commit | a938da539cf2313dc3c1b94deb099c7d6eab4c5c (patch) | |
tree | 985ef000a6323c141dba7b919caac613545f2b3c /sql/parse_file.cc | |
parent | 3bf44a86222cb935f31f28263e54442e9a10693d (diff) | |
parent | e20b9de18e0e73ba63069c43f780fae0e571f9ab (diff) | |
download | mariadb-git-a938da539cf2313dc3c1b94deb099c7d6eab4c5c.tar.gz |
manual merge 5.0-bugteam --> 5.1-bugteam
Diffstat (limited to 'sql/parse_file.cc')
-rw-r--r-- | sql/parse_file.cc | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/sql/parse_file.cc b/sql/parse_file.cc index 1f0a45edd5e..d8cbc7ff174 100644 --- a/sql/parse_file.cc +++ b/sql/parse_file.cc @@ -26,6 +26,9 @@ #include <my_sys.h> #include <my_dir.h> +/* from sql_db.cc */ +extern long mysql_rm_arc_files(THD *thd, MY_DIR *dirp, const char *org_path); + /** Write string with escaping. @@ -282,8 +285,9 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, DBUG_RETURN(TRUE); } - // archive copies management path[path_end]='\0'; +#ifdef FRM_ARCHIVE + // archive copies management: disabled unused feature (see bug #17823). if (!access(path, F_OK)) { if (old_version != ULONGLONG_MAX && max_versions != 0) @@ -330,6 +334,7 @@ sql_create_definition_file(const LEX_STRING *dir, const LEX_STRING *file_name, } } } +#endif//FRM_ARCHIVE { // rename temporary file @@ -352,6 +357,7 @@ err_w_file: /** Renames a frm file (including backups) in same schema. + @thd thread handler @param schema name of given schema @param old_name original file name @param new_name new file name @@ -363,7 +369,8 @@ err_w_file: @retval 1 Error (only if renaming of frm failed) */ -my_bool rename_in_schema_file(const char *schema, const char *old_name, +my_bool rename_in_schema_file(THD *thd, + const char *schema, const char *old_name, const char *new_name, ulonglong revision, uint num_view_backups) { @@ -377,9 +384,10 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, if (my_rename(old_path, new_path, MYF(MY_WME))) return 1; - /* check if arc_dir exists */ + /* check if arc_dir exists: disabled unused feature (see bug #17823). */ build_table_filename(arc_path, sizeof(arc_path) - 1, schema, "arc", "", 0); +#ifdef FRM_ARCHIVE if (revision > 0 && !access(arc_path, F_OK)) { char old_name_buf[FN_REFLEN], new_name_buf[FN_REFLEN]; @@ -400,6 +408,16 @@ my_bool rename_in_schema_file(const char *schema, const char *old_name, my_rename(old_path, new_path, MYF(0)); } } +#else//FRM_ARCHIVE + { // remove obsolete 'arc' directory and files if any + MY_DIR *new_dirp; + if ((new_dirp = my_dir(arc_path, MYF(MY_DONT_SORT)))) + { + DBUG_PRINT("my",("Archive subdir found: %s", arc_path)); + (void) mysql_rm_arc_files(thd, new_dirp, arc_path); + } + } +#endif//FRM_ARCHIVE return 0; } |