OSEC

Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com
 
Re: Corrupt MYD table - can not repair

From: Sergei Golubchik (sergmysql.com)
Date: Tue Jan 06 2004 - 15:24:17 CST


Hi!

On Jan 06, Mike Brickman wrote:
> Hi,
>
> I have a client who has managed to corrupt an MYD table so that it can
> not be repaired. I have tried:
>
> Myisamchk -re {table}
>
> And this crashes out with:
>
> myisamchk: error: Not enough memory for blob at 3960 (need 1090519040)
>
> and then quits.
>
> There is no complete backup of this file so I would like to recover as
> much data as possible.
>
> 4) What exactly does the error mean?

It means that myisamchk tries to allocate 1090519040 bytes to read a
blob of this size - and malloc() fails.

> 3) Are the internal structures of MYD files documented anywhere
> (url please)?

To my knowledge - no.

> 2) Why does myisamchk not fix the problem?

Because the problem is "Out Of Memory" error - this isn't something
myisamchk can fix :)

What happens is, myisamchk finds a something that looks like row header,
but in fact it is part of your data. Interpreting this row header
myisamchk thinks it belongs to a 1Gb blob.

It's unavoidable - when you ask to recover "as much as possible",
myisamchk does it, literally, and you may get spurious rows in the
result.

The negative effect is that spurious row header can abort the repair
process. To fix it, in 4.1.1 we added a new command-line option to
myisamchk: --max-record-length. If you happen to know that no row in
your table is longer than N, you may tell myisamchk that all rows longer
than that are false matches and should be ignored.

> 1) Are there any tools which will allow me to salvage some data?

myisamchk as of 4.1.1.

Regards,
Sergei

--
   __ ___ ___ ____ __
  / |/ /_ __/ __/ __ \/ / Sergei Golubchik <sergmysql.com>
 / /|_/ / // /\ \/ /_/ / /__ MySQL AB, Senior Software Developer
/_/ /_/\_, /___/\___\_\___/ Osnabrueck, Germany
       <___/ www.mysql.com

--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql