[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql
Subject: Re: Phantom Row
From: Van <vanboers () server ! dedserius ! com>
Date: 1999-08-04 4:59:49
[Download RAW message or body]
Benjamin Pflugmann wrote:
>
> Hi.
>
> First about that missing row:
>
> First check how many rows you get by doing "SELECT * FROM checking":
select * from checking;
390 rows in set (0.02 sec)
select count(*) from checking;
390
> [I am not sure if you meant this when you said you checked this with
> the command line client: Did you "SELECT *" or "SELECT COUNT(*)"?].
>
> If it is 379, you definitely have a corrupted index or table, since
> "SELECT *" or "SELECT COUNT(*)" are showing differnt results.
Yup.
>
> If it is 380, you have a row in the result set, where neither
> ($row[credit]<>0) nor ($row[debit]<>0) is true. In that case, your
> conditions in the while clause just do not trigger anything. (You
> could have checked out easily even without mysql_num_rows by adding
> another counter just for the number of loops your program stays in the
> while clause.)
Whoops, one row, in May, where I voided a transaction. Probably should
have placed a correcting entry. No matter. Data is still getting
corrupted.
Good catch, Benjamin. My eyes missed it, but, went right there when you
mentioned that.
>
> Now about the corrupted table:
>
> You did not mention how you replicated the database on the second
> server, by copying the binary files or by dumping and inserting SQL
> statements? If you copied the binary data and something was corrupt,
> the replicated database will also be corrupt, of course.
mysqldump -u -p -hotherhost dbase | \
mysql -u -p dbase
>
> It sounds quite strange to me, that MySQL would corrupt new created
> database.
>
> Could you try to run isamchk -e (without -R1,R2). If an index is
> corrupt, I guess there is a good chance that the -R option will do
> even more damage (ordering according to an corrupt index!).
>
> I would suggest, that you dump your entire table with mysqldump. Look
> how many INSERT statements you get. Then drop the table, and use the
> mysql command line client to execute the dumped statements. Check if
> your problem is gone then.
Will try this. Perhaps will correct it.
>
> Bye,
>
> Benjamin.
>
Thanks, mucho Benjamin. You've given me a little perspective. I'm
getting data in there and getting it to stay, but, I have to do a
mysqladmin refresh after every insert. Not good. There's something
wrong in there.
Peace,
Van
--
=========================================================================
Linux rocks!!! http://www.dedserius.com
=========================================================================
---------------------------------------------------------------------
Please check "http://www.mysql.com/Manual_chapter/manual_toc.html" before
posting. To request this thread, e-mail mysql-thread9290@lists.mysql.com
To unsubscribe, send a message to the address shown in the
List-Unsubscribe header of this message. If you cannot see it,
e-mail mysql-unsubscribe@lists.mysql.com instead.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic