I'm using MySQL 3.23.51. I have a table which started giving 127 errors.

Running myisamchk -i on it gives:

>Checking MyISAM file: /Users/rolf/WBD/back/clip.MYI
>Data records:   27497   Deleted blocks:       0
>./bin/myisamchk: warning: 9 clients is using or hasn't closed the 
>table properly
>- check file-size
>./bin/myisamchk: error: Size of datafile is: 8236926 
>Should be: 8238220
>- check key delete-chain
>- check record delete-chain
>- check index reference
>- check data record references index: 1
>Key:  1:  Keyblocks used:  91%  Packed:    0%  Max levels:  3
>- check data record references index: 2
>Key:  2:  Keyblocks used:  89%  Packed:    0%  Max levels:  3
>- check data record references index: 3
>Key:  3:  Keyblocks used:  56%  Packed:   97%  Max levels:  2
>- check data record references index: 4
>Key:  4:  Keyblocks used:  87%  Packed:  -12%  Max levels:  3
>Total:    Keyblocks used:  80%  Packed:   88%
>
>- check record links
>./bin/myisamchk: error: Wrong bytesec: 44-45-49 at linkstart: 7127940
>MyISAM-table '/Users/rolf/WBD/back/clip.MYI' is corrupted

Running myiasmchk -r -q fails with

>- check key delete-chain
>- check record delete-chain
>- recovering (with sort) MyISAM-table '/Users/rolf/WBD/back/test/clip.MYI'
>Data records: 27497
>- Fixing index 1
>Wrong bytesec:  44- 45- 49 at    7127940; Skipped
>MyISAM-table '/Users/rolf/WBD/back/test/clip.MYI' is not fixed 
>because of errors
>Try fixing it by using the --safe-recover (-o) or the --force (-f) option


Running myisamchk -r -o produces a ton of output

>- recovering (with keycache) MyISAM-table '/Users/rolf/WBD/back/test/clip.MYI'
>Data records: 1
>Wrong bytesec:  44- 45- 49 at    7127940; Skipped
>Found link that points at 3980867614565072899 (outside data file) at 6376
>Found link that points at 3980867614565072899 (outside data file) at 6528
>Found link that points at 3980867614565072899 (outside data file) at 6752
>Found link that points at 3980867614565072899 (outside data file) at 6904
>Found link that points at 3980867614565072899 (outside data file) at 7056
>..
>Found link that points at 3983412983983374339 (outside data file) at 229808
>Wrong bytesec:  55- 54- 57 at    7969612; Skipped
>Found link that points at 4025635330001666051 (outside data file) at 231384
>..
>Found link that points at 3480453488780115971 (outside data file) at 1069456
>Wrong bytesec:  55- 54- 57 at    7703144; Skipped
>Found block with too small length at 1081248; Skipped
>Wrong bytesec:  44- 45- 50 at    7707776; Skipped
>Wrong bytesec:  45- 50- 49 at    7712448; Skipped
>Wrong bytesec:  76-105-118 at    7795904; Skipped
>Found link that points at 3501284836079960067 (outside data file) at 1129552
>Found link that points at 3501284836079960067 (outside data file) at 1129712
>..
>Found block that points outside data file at 8221756
>Found link that points at 3980602636557746179 (outside data file) at 8222248
>Found block that points outside data file at 8222804
>Found block that points outside data file at 8222828
>Found block with too small length at 8222952; Skipped
>Found block that points outside data file at 8223048
>Found link that points at 3980602636557746179 (outside data file) at 8223128
>..
>Found block that points outside data file at 8230212
>Found block that points outside data file at 8231828
>Data records: 1030

It "recovers" my table but I end up with only 1030 out of 27497 rows, 
so that's not a log of help!

Running myisamchk -r -e gives a similar result (only 1030 rows are 
recovered), as does truncating the table first then restored the MYD 
file and running myiasmchk.

Any other suggestions as to what to try?

I'm happy to try to write some code of my own to walk through the MYD 
file and extract anything that looks like valid data. Is the MYD file 
format documented anywhere?

Many thanks,

-Rolf
-- 
Rolf Howarth, Square Box Systems Ltd, Stratford-upon-Avon UK.

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to