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>