From: Date: March 27 2008 7:33am Subject: bk commit into 5.0 tree (gshchepa:1.2604) BUG#17823 List-Archive: http://lists.mysql.com/commits/44498 X-Bug: 17823 Message-Id: <20080327063334.2F4DF40F933@localhost.localdomain> Below is the list of changes that have just been committed into a local 5.0 repository of gshchepa. When gshchepa does a push these changes will be propagated to the main repository and, within 24 hours after the push, to the public repository. For information on how to access the public repository see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html ChangeSet@stripped, 2008-03-27 10:33:13+04:00, gshchepa@stripped +2 -0 Fixed bug #17823: 'arc' directories inside database directories. Server creates "arc" directories inside database directories and maintains there useless copies of .frm files. Creation and renaming procedures of those copies as well as creation of "arc" directories has been discontinued. Removal procedure has been kept untouched to be able to cleanup existent database directories by the DROP DATABASE query. sql/parse_file.cc@stripped, 2008-03-27 10:31:18+04:00, gshchepa@stripped +6 -2 Fixed bug #17823. View/table creation and renaming procedures maintain backup copies of .frm files. Those copies are unused yet, so this feature is incomplete and unnecessary. Unwanted code has been hidden by FRM_ARCHIVE ifdefs (the FRM_ARCHIVE macro is not defined). sql/sql_db.cc@stripped, 2008-03-27 10:31:21+04:00, gshchepa@stripped +10 -1 Fixed bug #17823. Commentaries about the removal of orphaned "arc" directories have been added. diff -Nrup a/sql/parse_file.cc b/sql/parse_file.cc --- a/sql/parse_file.cc 2007-04-06 19:56:37 +05:00 +++ b/sql/parse_file.cc 2008-03-27 10:31:18 +04:00 @@ -265,8 +265,9 @@ sql_create_definition_file(const LEX_STR DBUG_RETURN(TRUE); } - // archive copies management path[path_end]='\0'; +#ifndef FRM_ARCHIVE + // archive copies management: disabled unused feature (see bug #17823). if (!access(path, F_OK)) { if (old_version != ULONGLONG_MAX && max_versions != 0) @@ -313,6 +314,7 @@ sql_create_definition_file(const LEX_STR } } } +#endif//FRM_ARCHIVE { // rename temporary file @@ -365,7 +367,8 @@ my_bool rename_in_schema_file(const char if (my_rename(old_path, new_path, MYF(MY_WME))) return 1; - /* check if arc_dir exists */ +#ifdef FRM_ARCHIVE + /* check if arc_dir exists: disabled unused feature (see bug #17823). */ strxnmov(arc_path, FN_REFLEN, mysql_data_home, "/", schema, "/arc", NullS); (void) unpack_filename(arc_path, arc_path); @@ -384,6 +387,7 @@ my_bool rename_in_schema_file(const char my_rename(old_path, new_path, MYF(0)); } } +#endif//FRM_ARCHIVE return 0; } diff -Nrup a/sql/sql_db.cc b/sql/sql_db.cc --- a/sql/sql_db.cc 2008-03-21 19:23:14 +04:00 +++ b/sql/sql_db.cc 2008-03-27 10:31:21 +04:00 @@ -906,7 +906,11 @@ static long mysql_rm_known_files(THD *th 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); @@ -1061,6 +1065,11 @@ static my_bool rm_dir_w_symlink(const ch 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)