Bug #17810 REPAIR says ok, CHECK says broken (repeatable)
Submitted: 28 Feb 2006 23:35 Modified: 3 Jul 2006 14:22
Reporter: Christian Hammers (Silver Quality Contributor) (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: MyISAM storage engine Severity:S3 (Non-critical)
Version:5.0 OS:Linux (Debian GNU/Linux)
Assigned to: Sergey Vojtovich
Tags: corruption, myisam

[28 Feb 2006 23:35] Christian Hammers
Description:
Hello

I have a Debian bug here (#354300) because of a table that is reported broken after each CHECK TABLE and ok after each REPAIR TABLE. The case is reproducible and I will attach that table.

bye,

-christian-

How to repeat:
mysql> CHECK TABLE searchindex ;
+------------------+-------+----------+------------------------------------+
| Table            | Op    | Msg_type | Msg_text                           |
+------------------+-------+----------+------------------------------------+
| test.searchindex | check | error    | Key in wrong position at page 4096 |
| test.searchindex | check | error    | Corrupt                            |
+------------------+-------+----------+------------------------------------+
2 rows in set (0.00 sec)

mysql> REPAIR TABLE searchindex EXTENDED ;
+------------------+--------+----------+----------+
| Table            | Op     | Msg_type | Msg_text |
+------------------+--------+----------+----------+
| test.searchindex | repair | status   | OK       |
+------------------+--------+----------+----------+
1 row in set (0.08 sec)

mysql> CHECK TABLE searchindex EXTENDED ;
+------------------+-------+----------+------------------------------------+
| Table            | Op    | Msg_type | Msg_text                           |
+------------------+-------+----------+------------------------------------+
| test.searchindex | check | error    | Key in wrong position at page 4096 |
| test.searchindex | check | error    | Corrupt                            |
+------------------+-------+----------+------------------------------------+

Suggested fix:
obvious :)
[28 Feb 2006 23:36] Christian Hammers
Broken tables

Attachment: searchindex.tgz (application/x-gtar, text), 65.92 KiB.

[1 Mar 2006 1:47] Hartmut Holzgraefe
verified with rather current 5.0bk (about 2 weeks old)
[5 Apr 2006 9:50] Jan Schmidt
Suffering the exact same bug, also on a mediawiki searchindex table. 

MySql server version here is: 5.0.18-Debian_8bpo1-log
[27 Apr 2006 7:51] Bugs System
A patch for this bug has been committed. After review, it may
be pushed to the relevant source trees for release in the next
version. You can access the patch from:

  http://lists.mysql.com/commits/5625
[6 May 2006 9:10] Sergey Vojtovich
Fixed in 5.0.21, 5.1.10.
[8 May 2006 18:41] Paul Dubois
Noted in 5.0.21, 5.1.10 changelogs.

<literal>REPAIR TABLE</literal> did not restore the length for
packed keys in tables created under MySQL 4.x. (Bug #17810)
[17 May 2006 15:08] Korbinian Rosenegger
Hi

I just downloaded the sources of 5.0.21 and this bug is NOT fixed in this relase!
The source .tar.gz is packed on Apr 26 20:31, the bugfix was commited on Apr 27 09:51.

cu Korbi
[17 May 2006 15:51] Paul Dubois
Looks like the change went into 5.0.22, not 5.0.21.
I've moved the change note.
[1 Jul 2006 11:25] Manuel Kiessling
I have this bug in 5.0.22, too. I upgraded from 4.0.24 to 5.0.22 (providing 5.0 with the data files of 4.0, no dumping etc.) on Debian GNU/Linux 3.1 (Sarge), Kernel 2.6.16.9 SMP, and had this behaviour with one of my MYISAM tables.

However, copying the whole table, then deleting it, then copying the backup table to the original name fixed the issue.
[3 Jul 2006 13:14] Sergey Vojtovich
5.0.22 was a security fix release. Expect fix in 5.0.23.
[3 Jul 2006 14:22] Paul Dubois
Change note is in 5.0.23.