diff options
author | unknown <msvensson@neptunus.(none)> | 2005-04-27 22:20:58 +0200 |
---|---|---|
committer | unknown <msvensson@neptunus.(none)> | 2005-04-27 22:20:58 +0200 |
commit | a1b0139fe7bfcd65312b07d267d40761eac1ca67 (patch) | |
tree | 6ad95df674d02e99cdfa846afc36b6eb635b2526 /sql/examples | |
parent | cde34dfbf3721769894f60eb430bdf6034ebc3b9 (diff) | |
download | mariadb-git-a1b0139fe7bfcd65312b07d267d40761eac1ca67.tar.gz |
BUG#9911 RENAME TABLE of type ARCHIVE fails with .ARN file error
- Different behaviuor in 5.0 pushes a warning when renaming a non existent file. Avoid that by checking that the file exists before renaming.
mysql-test/r/archive.result:
Warning is not produced anymore
sql/examples/ha_archive.cc:
Change ha_archive::rename_table to avoid warning when trying to rename non existent file.
Diffstat (limited to 'sql/examples')
-rw-r--r-- | sql/examples/ha_archive.cc | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/sql/examples/ha_archive.cc b/sql/examples/ha_archive.cc index e3ad677714f..58f8580e724 100644 --- a/sql/examples/ha_archive.cc +++ b/sql/examples/ha_archive.cc @@ -455,17 +455,22 @@ const char **ha_archive::bas_ext() const int ha_archive::rename_table(const char * from, const char * to) { DBUG_ENTER("ha_archive::rename_table"); + DBUG_PRINT("enter", ("from: %s, to: %s", from, to)); for (const char **ext=bas_ext(); *ext ; ext++) { - if (rename_file_ext(from,to,*ext)) + // Check if the .arn file exists before rename + if (!my_strcasecmp(system_charset_info, *ext, ARN)) { - if (my_errno == ENOENT && - !my_strcasecmp(system_charset_info, *ext, ARN)) + char name[FN_REFLEN]; + (void)strxnmov(name, FN_REFLEN, from, ARN, NullS); + if (access(name, F_OK)) + { + DBUG_PRINT("info", ("%s does not exist on disk, skipping it", name)); continue; - - DBUG_RETURN(my_errno); + } } - + if (rename_file_ext(from,to,*ext)) + DBUG_RETURN(my_errno); } DBUG_RETURN(0); } |