Bug #55504 mysqlcheck deletes .myd files
Submitted: 23 Jul 2010 11:31 Modified: 24 Jul 2010 5:48
Reporter: vincenzo antolini Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: General Severity:S1 (Critical)
Version:5.1.48-community OS:Windows (2003 STANDARD EDITION)
Assigned to: CPU Architecture:Any
Tags: delete, deleted, myd, mysqlcheck

[23 Jul 2010 11:31] vincenzo antolini
Description:
When I run 
- mysqlcheck -uroot -p --database demo_com --optimize
or
- mysqlcheck -uroot -p --database demo_com --repair

I get the DB corrupted. I can read on the output this

demo_com.products
error    : 5 when fixing table
Error    : Error on delete of 'D:\mysql\Data\demo_com\products.MYD' (Errcode: 5)
status   : Operation failed

Looking inside the data folder I can see a lot of files ending with ".MYD.0037C519.deleted" and original .MYD is missing.

I get "products.MYD.0037C519.deleted" but not "products.MYD".

I have done everyone full permission to the folder and run the command using Administrator.

How to repeat:
Run mysqlcheck -uroot -p --database demo_com --optimize
[23 Jul 2010 11:46] Valeriy Kravchuk
Please, send the results of

dir D:\mysql\Data\demo_com

and your my.ini file content, as a private file/comment if you want.
[23 Jul 2010 11:56] vincenzo antolini
I attach a screenshot of the folder.
I have run again the command mysqlcheck on the folder and it has corrupted again the database.
[23 Jul 2010 11:56] vincenzo antolini
data file AFTER mysqlcheck execution

Attachment: sshot-1.png (image/png, text), 43.83 KiB.

[23 Jul 2010 12:04] vincenzo antolini
mysqlcheck will delete the original .MYD file and leave a temporary one.
myisamchk will file because the original .MYD file is missing.

The only way to recover the situation is to rename all the temporary files.
[24 Jul 2010 5:48] MySQL Verification Team
Vincenzo, please don't use 'myisam_use_mmap' in my.cnf.
This is a duplicate of bug #49030