List:General Discussion« Previous MessageNext Message »
From:Michael Widenius Date:August 29 1999 3:38pm
Subject:corrupted ISD file ...
View as plain text  
>>>>> "Udo" == Udo Rader <udo@stripped> writes:

Udo> hi,
Udo> we have been running a mysql database 3.21.33b under suse linux 2.0.36
Udo> and apache 1.3.2 for more than a year now without major problems (and
Udo> without the need to update to newer version ...).

Udo> now I've run into a desastrous problem related to a table that contains
Udo> approx 11000 entries, only the first row of the table seems to be ok,
Udo> every other row seems to be shifted to the left by one byte. see what i
Udo> mean (this one was done with mysqldump):

Udo> 1. the first row is ok, it starts with yyyy,a week number and the
Udo> username ('ebi', which is correct)

Udo> INSERT INTO tips VALUES
Udo>
> (1999,1,'ebi',NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,NULL,NULL,0,1,0,2,2,1,5.5000);

Udo> 2. from now on every entry in the row is shifted one byte to the left,
Udo> the username now is 'ykov' but should be 'bykov' and of course yyyy and
Udo> the week number don`t fit at all ...

Udo> INSERT INTO tips VALUES
Udo> (16777223,1644167168,'ykov','','                            
Udo> \0',NULL,NULL,8192,'','                            
Udo> ',NULL,NULL,8192,'','                            
Udo> \0',NULL,NULL,8192,'','                            
Udo> \0',NULL,NULL,8192,'','                            
Udo> ',NULL,NULL,8192,'','                            
Udo> \0',NULL,NULL,8192,'','                            
Udo> ',NULL,NULL,8192,'','                            
Udo> ',NULL,NULL,8192,'','                            
Udo> ',NULL,NULL,8192,'','                            
Udo>
> ',0,0,NULL,NULL,NULL,NULL,NULL,NULL,100663296,16777216,NULL,3540237164354463596544.0000);
Udo> 3. the same here and all the rest of the rows, username is 'di' but
Udo> should be 'Eddi' ...

Udo> INSERT INTO tips VALUES
Udo> (65536,1682243584,'di',NULL,'                           
Udo> \0\0',0,1,NULL,NULL,'                           
Udo> \0',0,0,NULL,NULL,'                           
Udo> \0\0',0,1,NULL,NULL,'                           
Udo> \0\0',0,1,NULL,NULL,'                           
Udo> \0\0',0,1,NULL,NULL,'                           
Udo> \0\0',0,1,NULL,NULL,'                           
Udo> \0\0',1,0,NULL,NULL,'                           
Udo>
> \0',0,0,8224,'',NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,NULL,0,0,NULL,589824,65536,NULL,-0.0000);

Udo> the database is used for an internet online game and I know for sure,
Udo> that no one touched the database structure for a long time ...

Udo> isamchk -r and -o for version 3.21.33b and even for the most recent
Udo> version returns no error at all ...

Udo> which leads me to 3 questions:
Udo> 1. WHAT HAS HAPPENED??? WAAAAAAAAAAAAAAAAAAAAAAAAAAHHHH!!!
Udo> 2. I looked for a binary table file structure definition for ISD files,
Udo> in order to be able to manipulate the binary data directly - but did not
Udo> find one - is there one?
Udo> 3. is there a way to repair the table otherwise??


Hi!

Could you check the dates of the .frm file?  The only way I know of
something like this could happen is if someone has manipulated the
.frm file directly (for example copied back an old version) and got a
mismatch between the .frm and the data file.

It should be impossible for MySQL to shift all rows by just one byte;
If something like this happens, then its much more likely that
this has happened from the outside than from withing mysqld.
(We once experienced something similar here at TCX, but in this case
we found that the problem was a broken disk drive).

Could you please mail a description of the table + the output from:

isamchk -dvv table_name

If the case is really that everything has shifted one byte (after the
first row), you should be able to put this together by using 'dd' to a 
new file.  Just remember to make a backup of your data first!

Regards,
Monty



Thread
corrupted ISD file ...Udo Rader26 Aug
  • corrupted ISD file ...Michael Widenius29 Aug