diff options
Diffstat (limited to 'innobase/row/row0mysql.c')
-rw-r--r-- | innobase/row/row0mysql.c | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/innobase/row/row0mysql.c b/innobase/row/row0mysql.c index 35305b037c6..e94998f165f 100644 --- a/innobase/row/row0mysql.c +++ b/innobase/row/row0mysql.c @@ -2203,6 +2203,9 @@ row_rename_table_for_mysql( mem_heap_t* heap = NULL; char** constraints_to_drop = NULL; ulint n_constraints_to_drop = 0; + ibool recovering_temp_table = FALSE; + ulint namelen; + ulint keywordlen; ulint len; ulint i; char buf[10000]; @@ -2239,10 +2242,23 @@ row_rename_table_for_mysql( trx->op_info = (char *) "renaming table"; trx_start_if_not_started(trx); + namelen = ut_strlen(new_name); + + keywordlen = ut_strlen("_recover_innodb_tmp_table"); + + if (namelen >= keywordlen + && 0 == ut_memcmp(new_name + namelen - keywordlen, + (char*)"_recover_innodb_tmp_table", keywordlen)) { + + recovering_temp_table = TRUE; + } + /* Serialize data dictionary operations with dictionary mutex: no deadlocks can occur then in these operations */ - row_mysql_lock_data_dictionary(trx); + if (!recovering_temp_table) { + row_mysql_lock_data_dictionary(trx); + } table = dict_table_get_low(old_name); @@ -2409,8 +2425,10 @@ row_rename_table_for_mysql( } } } -funct_exit: - row_mysql_unlock_data_dictionary(trx); +funct_exit: + if (!recovering_temp_table) { + row_mysql_unlock_data_dictionary(trx); + } if (graph) { que_graph_free(graph); |