Bug #6265 DELETE+ INSERT .. SELECT + DELETE crash table.
Submitted: 26 Oct 2004 15:32 Modified: 11 Nov 2004 21:40
Reporter: Victoria Reznichenko Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S2 (Serious)
Version:4.1 OS:Windows (Windows, Linux)
Assigned to: Sergei Golubchik CPU Architecture:Any
Tags: corruption

[26 Oct 2004 15:32] Victoria Reznichenko
Description:
Combination of DELETE+ INSERT .. SELECT + DELETE crash MyISAM table. 

mysql> source test.sql;
Query OK, 22236 rows affected (1 min 34.72 sec)

Query OK, 22236 rows affected (1 min 17.02 sec)
Records: 22236  Duplicates: 0  Warnings: 0

ERROR 1034 (HY000): Incorrect key file for table 'search'; try to repair it
mysql> check table search;
+----------+-------+----------+----------------------------+
| Table    | Op    | Msg_type | Msg_text                   |
+----------+-------+----------+----------------------------+
| a.search | check | warning  | Table is marked as crashed |
| a.search | check | error    | Found 40572 keys of 40573  |
| a.search | check | error    | Corrupt                    |
+----------+-------+----------+----------------------------+
3 rows in set (0.16 sec)

How to repeat:
Tables are in data.zip file.
Queries in test.sql file.

mysql> source test.sql;
[26 Oct 2004 15:54] MySQL Verification Team
data.zip was uploaded to  ftp://ftp.mysql.com/pub/mysql/upload
[11 Nov 2004 17:10] Sergei Golubchik
Thank you for your bug report. This issue has been committed to our
source repository of that product and will be incorporated into the
next release.

If necessary, you can access the source repository and build the latest
available version, including the bugfix, yourself. More information 
about accessing the source trees is available at
    http://www.mysql.com/doc/en/Installing_source_tree.html

Additional info:

fixed in 4.1.6
[11 Nov 2004 21:40] Sergei Golubchik
fixed in 4.1.8
sorry for confusion