Bug #61598 | REPAIR and OPTIMIZE lead to table corruption | ||
---|---|---|---|
Submitted: | 22 Jun 2011 18:04 | Modified: | 12 Jan 2013 17:32 |
Reporter: | Danny Ross | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: MyISAM storage engine | Severity: | S1 (Critical) |
Version: | 5.1.57, 5.5.21, 5.6.5 | OS: | Linux |
Assigned to: | CPU Architecture: | Any | |
Tags: | corruption, Optimize, owner, regression, Repair |
[22 Jun 2011 18:04]
Danny Ross
[29 Nov 2011 18:32]
BigProf Software
This happened with me today ... After a lot of looking around, I was able to fix the corrupted table using: myisamchk -ofv tablename
[17 Jan 2012 18:39]
Sveta Smirnova
Thank you for the report. Verified as described, although table is not corrupted: just run query CHECK TABLE 2 times and crash mark would be removed: mysql> check table t1; +---------+-------+----------+---------------------------------------------------+ | Table | Op | Msg_type | Msg_text | +---------+-------+----------+---------------------------------------------------+ | test.t1 | check | warning | Table is marked as crashed and last repair failed | | test.t1 | check | status | OK | +---------+-------+----------+---------------------------------------------------+ 2 rows in set (0.00 sec) mysql> check table t1; +---------+-------+----------+----------+ | Table | Op | Msg_type | Msg_text | +---------+-------+----------+----------+ | test.t1 | check | status | OK | +---------+-------+----------+----------+ 1 row in set (0.00 sec) I would not say changing permissions of files is safe operation, so current behavior looks more proper than old one, but this change should be announced and documented.
[22 Feb 2012 1:09]
acido fil
5.5.20 this BUG(lets call it right name ;)) occurs too. As stated in the title.. after running "optimize" or "repair" Mysql changes file owner. Table needs to be repaired 1. running repair 1. fail (throws "Can't change ownership of the file" error) 2. manually changing file owner to right one(mysql) 2. success 3. trying repair again 3. fail, mysql __automatically changes owner again__.. OMG WHY?!!
[23 Apr 2012 3:48]
Juan Manuel Doren
I had the same problem when the original table has rwxrwxrwx mode, i just changed it to rw-rw---- owner mysql ansd group mysql and now it works fine
[4 Aug 2012 10:47]
Umut Akyol
This is literally annoying. My solution on Debian is remove the package 5.1 and install 5.0.
[12 Jan 2013 17:32]
Paul DuBois
Noted in 5.1.50, 5.5.6 changelogs. REPAIR TABLE and OPTIMIZE TABLE table now catch and throw any errors that occur while copying table statistics from the old corrupted file to newly created file. For example. if the user ID of the owner of the .frm, .MYD, or .MYI file is different from the user ID of the mysqld process, REPAIR TABLE and OPTIMIZE TABLE generate a "cannot change ownership of the file" error unless mysqld is started by the root user.