Bug #716 MySQL 4.0.13 Corrupts MyISAM tables on Windows
Submitted: 24 Jun 2003 19:19 Modified: 9 Jul 2003 21:52
Reporter: Mark Matthews Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server Severity:S1 (Critical)
Version:4.0.13 OS:Windows (Windows)
Assigned to: MySQL Verification Team CPU Architecture:Any

[24 Jun 2003 19:19] Mark Matthews
Description:
This is a re-submittal (with cleanup of comments) of bug #713 (which is now marked as a duplicate). Miguel and I have both been able to reproduce this behavior using the supplied SQL queries.

(from user):

I have a test machine and a live machine.  Fortunately I installed mySQL
4.0.13 on the test machine, because it is corrupting tables on the most
basic operations.  I start with a blank table, do an insert, and boom I
receive "Got error 22 from table handler" then "error: 145" file corrupted.

This is a WinXP machine, was working fine on mySQL 3.
I've managed to create a very simple repro.  Is this a known issue?

Also, when importing it seems that maybe v3 dumps aren't compatible with
v4?? This is not good.  I import a whole table without errors, but then its
empty.

How to repeat:
mysql> DROP TABLE IF EXISTS whosonline;
Query OK, 0 rows affected (0.02 sec)

mysql> CREATE TABLE whosonline (
    ->   MemberID mediumint(8) unsigned NOT NULL default '0',
    ->   PRIMARY KEY  (MemberID)
    -> ) TYPE=MyISAM;
Query OK, 0 rows affected (0.05 sec)

mysql> /*!40000 ALTER TABLE whosonline DISABLE KEYS */;
Query OK, 0 rows affected (0.01 sec)

mysql> LOCK TABLES whosonline WRITE;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO whosonline VALUES (22588);
Query OK, 1 row affected (0.02 sec)

mysql> /*!40000 ALTER TABLE whosonline ENABLE KEYS */;
Query OK, 0 rows affected (0.00 sec)

mysql> UNLOCK TABLES;
Query OK, 0 rows affected (0.00 sec)

mysql> INSERT INTO whosonline SET MemberID="218";
ERROR 1030: Got error 22 from table handler
mysql> check table whosonline;
+-----------------+-------+----------+------------------------------------------
-------+
| Table           | Op    | Msg_type | Msg_text                                 
      |
+-----------------+-------+----------+------------------------------------------
-------+
| test.whosonline | check | warning  | Table is marked as crashed               
      |
| test.whosonline | check | warning  | Size of indexfile is: 2048      Should
be: 1024 |
| test.whosonline | check | warning  | Size of datafile is: 5       Should be: 0
      |
| test.whosonline | check | error    | Found 1 keys of 0                        
      |
| test.whosonline | check | error    | Corrupt                                  
      |
+-----------------+-------+----------+------------------------------------------
-------+
5 rows in set (0.03 sec)

<cut>
[24 Jun 2003 19:53] Mark Matthews
This bug is _not_ reproducible on 4.0.13 for Linux (both Salle and I have tried it there).
[24 Jun 2003 21:57] [ name withheld ]
Please note this is actually 2 bugs - after the first insert, the data is not actually inserted.  That may be where the problem actually occurs.
[7 Jul 2003 22:07] MySQL Verification Team
Patch submitted for approval.
[9 Jul 2003 21:52] MySQL Verification Team
Thank you for the bug report this issue was already
fixed by Monty. ChangeSet  1.1495 03/07/08 .