WL#388: CHECK/REPAIR table enhancement

Status: Un-Assigned   —   Priority: Medium

Currently CHECK/REPAIR table command for MYISAM tables works the same way as 
MYISAMCHK utility, not taking in account .frm file and so unable to detect all 
types of errors. 

So basically the idea is to check if table definition in .frm file corresponds 
to internal MYISAM definition in MYI file. If it is not, error should be 
reported by CHECK TABLE and REPAIR TABLE should refuse to repair the table. 

To REPAIR such dammaged table one will need to get correct frm file (by 
creating the table of same structure or from backup) and  repair using USE_FRM 

One more reason why this is important - it is possible for MYI file to be 
dammaged such way it will be sill looking as correct table definition, but 
different from one it originally was. Then MySQL will use this file to try to 
repair the table it will produce great mess instead of data, which will result 
in data loss.