diff options
author | Sergei Golubchik <serg@mariadb.org> | 2018-10-28 01:10:15 +0200 |
---|---|---|
committer | Sergei Golubchik <serg@mariadb.org> | 2018-10-28 01:22:18 +0200 |
commit | 87d852f102a7f733a774252d9a446377ac51a976 (patch) | |
tree | cd54a22ca68b201daa24e449d9ce63858d257f0c /storage/innobase/handler/ha_innodb.cc | |
parent | 37ab7e45963627f3c1ea2dd43d5b305de37bb16f (diff) | |
parent | da34c7de5dacac85c4dc1f714bcd7edf3b7fe5f9 (diff) | |
download | mariadb-git-87d852f102a7f733a774252d9a446377ac51a976.tar.gz |
Merge branch 'merge/merge-innodb-5.6' into 10.0
Diffstat (limited to 'storage/innobase/handler/ha_innodb.cc')
-rw-r--r-- | storage/innobase/handler/ha_innodb.cc | 68 |
1 files changed, 38 insertions, 30 deletions
diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 2092cd113a5..c775a89918c 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -2015,6 +2015,11 @@ innobase_get_lower_case_table_names(void) { return(lower_case_table_names); } +/** return one of the tmpdir path +@return tmpdir path*/ +UNIV_INTERN +char* +innobase_mysql_tmpdir(void) { return (mysql_tmpdir); } /** Create a temporary file in the location specified by the parameter path. If the path is null, then it will be created in tmpdir. @@ -10903,35 +10908,36 @@ innobase_rename_table( row_mysql_lock_data_dictionary(trx); - dict_table_t* table = dict_table_open_on_name(norm_from, TRUE, FALSE, - DICT_ERR_IGNORE_NONE); + dict_table_t* table = NULL; + table = dict_table_open_on_name(norm_from, TRUE, FALSE, + DICT_ERR_IGNORE_NONE); - /* Since DICT_BG_YIELD has sleep for 250 milliseconds, + /* Since DICT_BG_YIELD has sleep for 250 milliseconds, Convert lock_wait_timeout unit from second to 250 milliseconds */ - long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; - if (table != NULL) { - for (dict_index_t* index = dict_table_get_first_index(table); - index != NULL; - index = dict_table_get_next_index(index)) { - - if (index->type & DICT_FTS) { - /* Found */ - while (index->index_fts_syncing - && !trx_is_interrupted(trx) - && (lock_wait_timeout--) > 0) { - DICT_BG_YIELD(trx); - } - } - } - dict_table_close(table, TRUE, FALSE); - } + long int lock_wait_timeout = thd_lock_wait_timeout(thd) * 4; + if (table != NULL) { + for (dict_index_t* index = dict_table_get_first_index(table); + index != NULL; + index = dict_table_get_next_index(index)) { + + if (index->type & DICT_FTS) { + /* Found */ + while (index->index_fts_syncing + && !trx_is_interrupted(trx) + && (lock_wait_timeout--) > 0) { + DICT_BG_YIELD(trx); + } + } + } + dict_table_close(table, TRUE, FALSE); + } - /* FTS sync is in progress. We shall timeout this operation */ - if (lock_wait_timeout < 0) { - error = DB_LOCK_WAIT_TIMEOUT; - row_mysql_unlock_data_dictionary(trx); - DBUG_RETURN(error); - } + /* FTS sync is in progress. We shall timeout this operation */ + if (lock_wait_timeout < 0) { + error = DB_LOCK_WAIT_TIMEOUT; + row_mysql_unlock_data_dictionary(trx); + DBUG_RETURN(error); + } /* Transaction must be flagged as a locking transaction or it hasn't been started yet. */ @@ -11086,12 +11092,14 @@ ha_innobase::rename_table( my_error(ER_TABLE_EXISTS_ERROR, MYF(0), to); error = DB_ERROR; - } else if (error == DB_LOCK_WAIT_TIMEOUT) { - my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to); - - error = DB_LOCK_WAIT; } + else if (error == DB_LOCK_WAIT_TIMEOUT) { + my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0), to); + + error = DB_LOCK_WAIT; + } + DBUG_RETURN(convert_error_code_to_mysql(error, 0, NULL)); } |