Bug #9911 RENAME TABLE of type ARCHIVE fails with .ARN file error
Submitted: 14 Apr 2005 16:29 Modified: 28 Apr 2005 15:19
Reporter: Jeff Ulmer Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.1.11 OS:Linux (Linux)
Assigned to: Magnus Blåudd CPU Architecture:Any

[14 Apr 2005 16:29] Jeff Ulmer
Description:
When attempting to rename an ARCHIVE table the process fails midway through due to a .ARN file not existing.

The .ARZ file is successfully changed however the .ARM and .frm are left unchanged and thus the database breaks.

Specific error returned by the server is:

ERROR 7 (HY000): Error on rename of './abc/blah.ARN' to './abc/whatever.ARN' (Errcode: 2)

How to repeat:
CREATE TABLE `blah` ( `something` varchar(10)) TYPE=ARCHIVE;
RENAME TABLE `blah` TO `whatever`;

Suggested fix:
A check probably needs to be implemented to see if the table is being optimized and not permit the rename during optimization - this then would avoid a .ARN file needing to be renamed, or perhaps this is just a simple typo and .ARN should be .ARM?
I havnt looked at the source code so this is just a wild guess.
[15 Apr 2005 19:56] Brian Aker
If the .arn file doesn't currently exist, the behavior should be to silently ignore and do the rename.  This means that the default rename operation that is based on bas_ext() is not behaving correctly.
[26 Apr 2005 9:36] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24303
[27 Apr 2005 20:12] Magnus Blåudd
Added the function ha_archive::rename_table which ignores the error that occurs when nonexisting .arn file is renamed
Pushed to 4.1.12 and 5.0.6
[27 Apr 2005 20:23] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24402
[28 Apr 2005 8:49] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/internals/24439
[28 Apr 2005 15:19] Paul DuBois
Noted in 4.1.12, 5.0.6 changelogs.