From: Date: November 16 2006 12:13pm Subject: bk commit into 5.1 tree (holyfoot:1.2328) BUG#22634 List-Archive: http://lists.mysql.com/commits/15401 X-Bug: 22634 Message-Id: <20061116111357.4F290700027@deer.myoffice.izhnet.ru> Below is the list of changes that have just been committed into a local 5.1 repository of hf. When hf 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, 2006-11-16 15:13:48+04:00, holyfoot@stripped +1 -0 bug #22634 (partitioned tables with DATA DIRECTORY option corrupts table) In fact the problem is inside the ARCHIVE engine. It stores real datapath inside the ARM file, but doesn't implement specific ha_archive::rename_table function. As the ALTER TABLE statement first creates the table with the temporary name and then renames it to the normal one, we get the temporary name saved in ARM what leads to "can't open file" error. Code modified to store only path in the ARM, without filename. storage/archive/ha_archive.cc@stripped, 2006-11-16 15:13:44+04:00, holyfoot@stripped +7 -3 now we store only path in the ARM file, not the full filename, then we add the tablename as a filename after reading the metafile. # This is a BitKeeper patch. What follows are the unified diffs for the # set of deltas contained in the patch. The rest of the patch, the part # that BitKeeper cares about, is below these diffs. # User: holyfoot # Host: deer.(none) # Root: /home/hf/work/22634/my51-22634 --- 1.108/storage/archive/ha_archive.cc 2006-11-16 15:13:57 +04:00 +++ 1.109/storage/archive/ha_archive.cc 2006-11-16 15:13:57 +04:00 @@ -470,7 +470,7 @@ ARCHIVE_SHARE *ha_archive::get_share(con Since we now possibly no real_path, we will use it instead if it exists. */ if (*share->real_path) - fn_format(share->data_file_name, share->real_path, "", ARZ, + fn_format(share->data_file_name, table_name, share->real_path, ARZ, MY_REPLACE_EXT|MY_UNPACK_FILENAME); VOID(my_hash_insert(&archive_open_tables, (byte*) share)); thr_lock_init(&share->lock); @@ -698,9 +698,13 @@ int ha_archive::create(const char *name, goto error; } + /* + We reuse name_buff since it is available. + */ write_meta_file(create_file, 0, stats.auto_increment_value, 0, - (char *)create_info->data_file_name, - FALSE); + (create_info->data_file_name && + dirname_part(name_buff, (char*)create_info->data_file_name)) + ? name_buff : 0, FALSE); my_close(create_file,MYF(0)); /*