Bug #62230 Innodb fails on any alter table statement
Submitted: 23 Aug 2011 0:20 Modified: 17 Jan 2012 16:54
Reporter: Bob Wilson Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: InnoDB storage engine Severity:S2 (Serious)
Version:5.5.15-log OS:Linux (Debian )
Assigned to: CPU Architecture:Any
Tags: ALTER TABLE, error 1025, innodb

[23 Aug 2011 0:20] Bob Wilson
Description:
Any Alter table operation will fail with Error 1025 and show up as a foreign key error. This is client independent.

I've seen some bugs that involve specific alter table operations, but I can't make any changes to my InnoDB tables, not even move them to MyISAM. I have absolutely no foreign keys, it is very strange that every alter table statement should end up logged as an FK issue.

I've tried changing tables to MyISAM, changing fieldnames, datatypes, etc. The only recourse is dropping the table and recreating it. 

Here are some entries in the Log:

LATEST FOREIGN KEY ERROR
------------------------
InnoDB: Renaming table `s`.`completed` to `s`.<result 2 when explaining filename '#sql2-96c-5dd'> failed!
InnoDB: Renaming table `s`.`completed` to `s`.<result 2 when explaining filename '#sql2-96c-5e0'> failed!
InnoDB: Renaming table `s`.`completed3` to `s`.<result 2 when explaining filename '#sql2-96c-608'> failed!
InnoDB: Renaming table `s2`.`form` to `s2`.`forms` failed!

How to repeat:
Make a simple InnoDB table and try to change something (a field name).
[23 Aug 2011 15:13] Valeriy Kravchuk
Please, upload the entire error log of your server (compressed if it's big).
[23 Aug 2011 16:22] Bob Wilson
I'm going to attach some notes of interest in the log. I have to ask the sa if I am allowed to release the entire log(which contains private info,ips etc). It may not be necessary.

I think I found the problem, I removed force recovery and it seems to work now. The Foreign key error message though should be rectified...it was very misleading. Thanks....

110813 21:31:42 [Note] /usr/local/mysql/bin/mysqld: ready for connections.
Version: '5.5.15-log'  socket: '/var/run/mysqld/mysqld.sock'  port: 3306  MySQL Community Server (GPL)
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
InnoDB: A new raw disk partition was initialized or
InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.
110819 16:45:52 [Warning] Invalid (old?) table or database name '#sql2-96c-5dd'
[17 Jan 2012 16:54] Sveta Smirnova
Thank you for the feedback.

Closed as "Not a Bug" because last comment. Regarding to the message innodb_force_recovery is special option which must be used only in recovery mode and never in normal operations. Actually error log file contains proper error message:

InnoDB: innodb_force_recovery is on: we do not allow
InnoDB: database modifications by the user. Shut down
InnoDB: mysqld and edit my.cnf so that newraw is replaced
InnoDB: with raw, and innodb_force_... is removed.