Bug#16914007-INNODB: CHECK TABLE SHOULD MARK AN INDEX AS CORRUPTED

IF IT HAS A WRONG COUNT

If CHECK TABLE finds that a secondary index contains the wrong
number of entries, it used to report an error but not mark the
index as corrupt. The error means that the index should be rebuilt,
which can be done with ALTER TABLE DROP INDEX and ALTER TABLE ADD
INDEX.  But just in case the DBA does not pay any attention to the
output of CHECK TABLE, the secondary index should be marked as
corrupted so that it is not used again.

Approved by Inaam in RB:2607
This commit is contained in:
unknown 2013-06-14 13:33:37 -05:00
parent 45f739bd9d
commit e0c68b1504

View file

@ -8600,6 +8600,9 @@ ha_innobase::check(
(ulong) n_rows,
(ulong) n_rows_in_table);
is_ok = FALSE;
row_mysql_lock_data_dictionary(prebuilt->trx);
dict_set_corrupted(index);
row_mysql_unlock_data_dictionary(prebuilt->trx);
}
}