For some reason, it's not the first thing I think of when diagnosing very strange table errors. I had an issue when doing an order by
I'd wind up with only one record. Explain
said I should have 28 rows, if I take out the order by
I have 28 rows. Well, the problem was table corruption, but unlike some errors where MySQL goes right out and tells you your table is corrupt, I didn't know until I checked it.
I was just wondering if there is a list, or we could make a list of all the times when a MySQL database is corrupted, but you might not necessarily know it is.
Run
CHECK TABLE
on the table.Fatal errors when trying to read/write to a table is the evidence in most of the cases I've run into.
Also,
EXPLAIN
only provides an estimated number of rows, so I wouldn't necessarily consider anEXPLAIN
output with an unexpected number of rows read/returned as an indication of table corruption.