diff options
author | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-16 15:13:48 +0400 |
---|---|---|
committer | unknown <holyfoot/hf@mysql.com/deer.(none)> | 2006-11-16 15:13:48 +0400 |
commit | 16e96aac54e72e6a2e1305292747a6e47da0e449 (patch) | |
tree | 50fb1d3f14ddc350f3977b84956d0620fafea68c /storage/archive | |
parent | bbc5d13891e09447d399112dfa9fa1b9da929b64 (diff) | |
download | mariadb-git-16e96aac54e72e6a2e1305292747a6e47da0e449.tar.gz |
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:
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.
Diffstat (limited to 'storage/archive')
-rw-r--r-- | storage/archive/ha_archive.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc index b7673fc96ea..8204c7622e4 100644 --- a/storage/archive/ha_archive.cc +++ b/storage/archive/ha_archive.cc @@ -470,7 +470,7 @@ ARCHIVE_SHARE *ha_archive::get_share(const char *table_name, 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, TABLE *table_arg, 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)); /* |