Bug #4310 RENAME
Submitted: 28 Jun 2004 16:57 Modified: 28 Jun 2004 22:09
Reporter: Steven Davis Email Updates:
Status: Can't repeat Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S2 (Serious)
Version:4.0.18 for pc-linux on i686 OS:Linux (Linux)
Assigned to: Dean Ellis CPU Architecture:Any

[28 Jun 2004 16:57] Steven Davis
Description:
I had an admin rename a table to itself.  This caused the server to lock up.  She was under the impression that the table names were case sensitive.

How to repeat:
rename <table_name> <TABLE_NAME>;

Suggested fix:
if (strcmp(argv[1], argv[2]) == 0){
    fprintf(stderr, "Error on rename of '%-.64s' to '%-.64s' (errno: %d)", argv[1], argv[2], 17);
}
[28 Jun 2004 22:09] Dean Ellis
I cannot repeat this with 4.0.21.  If the filesystem is case-sensitive, the table names will also be case-sensitive, unless you have changed your lower_case_table_names setting.  I tested that as well, however.

If you have a repeatable test case with the specific server settings and steps to take to demonstrate the lockup, please let us know.
[28 Mar 2006 20:22] David Spies
We just ran into the same problem running the following query:
ALTER TABLE `dev_warehouse`.`tblquestioncontrols` RENAME TO dev_warehouse`.`tblQuestionControls`;

We are running Suse Linux 9.1 and using MySQL 4.1.7-standard.  Our filesystem is case sensitive and to the best of my knowledge, we have not modified the lower_case_table_names setting.  I was able to rename two other tables in the same manner *** before this error locked up our system.  The above query locked up the system twice.  It was only after the system locked up the second time that it occurred to us that the problem may be a bug.

*** The other queries are as follows:
Alter table `dev_warehouse`.`tblformcontrols` RENAME TO dev_warehouse`.`tblFormControls`

Alter table `dev_warehouse`.`tblresponsecontrols` RENAME TO dev_warehouse`.`tblResponseControls`

David Spies