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
parent 82d9c8e8
......@@ -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);
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment