Commit 4d40985a authored by Jimmy Yang's avatar Jimmy Yang

Fix Bug 12922077 - SEGV IN DICT_SET_CORRUPTED_INDEX_CACHE_ONLY(), DROP TABLE

rb://752 approved by Sunny Bains
parent f0b0df2d
...@@ -5206,7 +5206,8 @@ UNIV_INTERN ...@@ -5206,7 +5206,8 @@ UNIV_INTERN
void void
dict_set_corrupted_index_cache_only( dict_set_corrupted_index_cache_only(
/*================================*/ /*================================*/
dict_index_t* index) /*!< in/out: index */ dict_index_t* index, /*!< in/out: index */
dict_table_t* table) /*!< in/out: table */
{ {
ut_ad(index); ut_ad(index);
ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(mutex_own(&dict_sys->mutex));
...@@ -5216,7 +5217,14 @@ dict_set_corrupted_index_cache_only( ...@@ -5216,7 +5217,14 @@ dict_set_corrupted_index_cache_only(
/* Mark the table as corrupted only if the clustered index /* Mark the table as corrupted only if the clustered index
is corrupted */ is corrupted */
if (dict_index_is_clust(index)) { if (dict_index_is_clust(index)) {
index->table->corrupted = TRUE; dict_table_t* corrupt_table;
corrupt_table = table ? table : index->table;
ut_ad(!index->table || !table || index->table == table);
if (corrupt_table) {
corrupt_table->corrupted = TRUE;
}
} }
index->type |= DICT_CORRUPT; index->type |= DICT_CORRUPT;
......
...@@ -1497,7 +1497,8 @@ dict_load_indexes( ...@@ -1497,7 +1497,8 @@ dict_load_indexes(
dictionary cache for such metadata corruption, dictionary cache for such metadata corruption,
since we would always be able to set it since we would always be able to set it
when loading the dictionary cache */ when loading the dictionary cache */
dict_set_corrupted_index_cache_only(index); dict_set_corrupted_index_cache_only(
index, table);
fprintf(stderr, fprintf(stderr,
"InnoDB: Index is corrupt but forcing" "InnoDB: Index is corrupt but forcing"
......
...@@ -1298,7 +1298,8 @@ UNIV_INTERN ...@@ -1298,7 +1298,8 @@ UNIV_INTERN
void void
dict_set_corrupted_index_cache_only( dict_set_corrupted_index_cache_only(
/*================================*/ /*================================*/
dict_index_t* index); /*!< in/out: index */ dict_index_t* index, /*!< in/out: index */
dict_table_t* table); /*!< in/out: table */
/**********************************************************************//** /**********************************************************************//**
Flags a table with specified space_id corrupted in the table dictionary Flags a table with specified space_id corrupted in the table dictionary
......
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