Bug #3808 delete corrupts table with error 1034
Submitted: 18 May 2004 11:48 Modified: 25 Jun 2004 15:10
Reporter: a b
Status: Closed
Category:Server Severity:S2 (Serious)
Version:4.1.1-alpha-standard-log OS:Linux (Linux 2.4.20)
Assigned to: Bugs System Target Version:

[18 May 2004 11:48] a b
Description:
After upgrading from 3.23.x to 4.1.1 (because of the character set features) I cannot
delete rows in a certain table without crashing the table. After the crash the table can
be repaired with myisamchk.

How to repeat:
Download 
  http://www.mantscheff.net/veranstaltung.2004-05-18.sql.gz (1.5 MB)
Feed it into a Mysql 4.1.1-alpha-standard-log server.
Start the MySQL client and enter:
  delete from veranstaltung where datum < '2004-05-19'

If this does not lead to an error, try:
  delete from veranstaltung where datum < '2004-07-01'
[10 Jun 2004 1:00] Timothy Smith
Verified under FreeBSD 5.1, 4.1.3 from 2004-06-08:

mysql> check table veranstaltung;
+--------------------+-------+----------+----------+
| Table              | Op    | Msg_type | Msg_text |
+--------------------+-------+----------+----------+
| test.veranstaltung | check | status   | OK       |
+--------------------+-------+----------+----------+
1 row in set (1.62 sec)

mysql> delete from veranstaltung where datum < '2004-05-19';
ERROR 1034 (HY000): Incorrect key file for table: 'veranstaltung'; try to repair it
mysql> check table veranstaltung;
+--------------------+-------+----------+----------------------------+
| Table              | Op    | Msg_type | Msg_text                   |
+--------------------+-------+----------+----------------------------+
| test.veranstaltung | check | warning  | Table is marked as crashed |
| test.veranstaltung | check | error    | Found 37552 keys of 37553  |
| test.veranstaltung | check | error    | Corrupt                    |
+--------------------+-------+----------+----------------------------+
3 rows in set (0.01 sec)
[25 Jun 2004 15: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.3
[21 Jul 2005 14:55] Jean-Roch Lefort
Hello, 

I am still able to reproduce the problem with a version 4.1.13 on a MyISAM table. In
order to see the error, you only have to delete a large portion of data from a quite
large table (about 1 million rows). 

Notice that using Berkeley DB engine instead of MyISAM seems to help not habing the
problem, but you also loose a great deal of performance.

jr