Bug #4267 Incorrect key file for table doing DELETE
Submitted: 24 Jun 2004 1:47 Modified: 24 Jun 2004 9:43
Reporter: Dave Torr Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: ISAM storage engine Severity:S3 (Non-critical)
Version:4.1.2 ALpha OS:Windows (Win XP Pro)
Assigned to: Assigned Account CPU Architecture:Any

[24 Jun 2004 1:47] Dave Torr
Description:
If I execute the statement:

DELETE location_table FROM location_table, temp_join_table WHERE id=location_id

where temp_join_table contains multiple records then the action is as expected - records in location_table having location_id equal to one of the ids in temp_join_table are deleted.

However - if there is only one record in temp_join_table then the corresponding record in location_table seems to be deleted, but there is then an error reported "Incorrect key file for table location_table" and I have to repair the table using myisamchk.

There is an obvious workaround for me - test the number of records in temp_join_table and if only one do a simple DELETE, but this looks like a bug to me?

How to repeat:
I can send the table definitons and data if required, but it should be pretty easy to replicate
[24 Jun 2004 9:43] Ramil Kalimullin
Thanks for your bug report.
It looks like this bug is a duplicate 
(see Bug #4198: Incorrect key file for table).