diff options
author | Sergey Vojtovich <svoj@mariadb.org> | 2018-03-29 22:38:26 +0400 |
---|---|---|
committer | Sergey Vojtovich <svoj@mariadb.org> | 2018-04-04 14:09:37 +0400 |
commit | d6d58836bb1aced62c17b4ec629a15730eec804a (patch) | |
tree | 4db10b04034049afc721b8340f68abcb161b68c7 | |
parent | a5da1c64f8d96278c8e4408458f7e8d4b6dea415 (diff) | |
download | mariadb-git-d6d58836bb1aced62c17b4ec629a15730eec804a.tar.gz |
MDEV-15773 - trx_allocate_for_background() -> trx_create()
trx_free_resurrected(): Remove, unused function
-rw-r--r-- | storage/innobase/dict/dict0dict.cc | 4 | ||||
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 4 | ||||
-rw-r--r-- | storage/innobase/dict/dict0stats.cc | 6 | ||||
-rw-r--r-- | storage/innobase/fts/fts0fts.cc | 28 | ||||
-rw-r--r-- | storage/innobase/fts/fts0opt.cc | 4 | ||||
-rw-r--r-- | storage/innobase/fts/fts0que.cc | 2 | ||||
-rw-r--r-- | storage/innobase/handler/i_s.cc | 6 | ||||
-rw-r--r-- | storage/innobase/include/trx0trx.h | 12 | ||||
-rw-r--r-- | storage/innobase/row/row0ftsort.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0merge.cc | 2 | ||||
-rw-r--r-- | storage/innobase/row/row0mysql.cc | 6 | ||||
-rw-r--r-- | storage/innobase/row/row0trunc.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0purge.cc | 2 | ||||
-rw-r--r-- | storage/innobase/trx/trx0trx.cc | 34 |
14 files changed, 39 insertions, 75 deletions
diff --git a/storage/innobase/dict/dict0dict.cc b/storage/innobase/dict/dict0dict.cc index db3dc2c2e0c..c88dceafd2d 100644 --- a/storage/innobase/dict/dict0dict.cc +++ b/storage/innobase/dict/dict0dict.cc @@ -422,7 +422,7 @@ dict_table_try_drop_aborted( { trx_t* trx; - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "try to drop any indexes after an aborted index creation"; row_mysql_lock_data_dictionary(trx); trx_set_dict_operation(trx, TRX_DICT_OP_INDEX); @@ -2034,7 +2034,7 @@ dict_table_remove_from_cache_low( /* When evicting the table definition, drop the orphan indexes from the data dictionary and free the index pages. */ - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 03e87e5df09..517b9019524 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -894,7 +894,7 @@ dict_update_filepath( ut_ad(rw_lock_own(dict_operation_lock, RW_LOCK_X)); ut_ad(mutex_own(&dict_sys->mutex)); - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "update filepath"; trx->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx, TRX_DICT_OP_INDEX); @@ -963,7 +963,7 @@ dict_replace_tablespace_and_filepath( ut_ad(mutex_own(&dict_sys->mutex)); ut_ad(filepath); - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "insert tablespace and filepath"; trx->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx, TRX_DICT_OP_INDEX); diff --git a/storage/innobase/dict/dict0stats.cc b/storage/innobase/dict/dict0stats.cc index 9148fe9125f..b2de9412830 100644 --- a/storage/innobase/dict/dict0stats.cc +++ b/storage/innobase/dict/dict0stats.cc @@ -299,7 +299,7 @@ dict_stats_exec_sql( } if (trx == NULL) { - trx = trx_allocate_for_background(); + trx = trx_create(); trx_started = true; if (srv_read_only_mode) { @@ -2505,7 +2505,7 @@ dict_stats_save( return(ret); } - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); trx_start_internal(trx); dict_index_t* index; @@ -2984,7 +2984,7 @@ dict_stats_fetch_from_ps( stats. */ dict_stats_empty_table(table, true); - trx = trx_allocate_for_background(); + trx = trx_create(); /* Use 'read-uncommitted' so that the SELECTs we execute do not get blocked in case some user has locked the rows we diff --git a/storage/innobase/fts/fts0fts.cc b/storage/innobase/fts/fts0fts.cc index 04e10551cb2..da92f0f4a69 100644 --- a/storage/innobase/fts/fts0fts.cc +++ b/storage/innobase/fts/fts0fts.cc @@ -472,7 +472,7 @@ fts_load_user_stopword( trx_t* trx; ibool has_lock = fts->fts_status & TABLE_DICT_LOCKED; - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "Load user stopword table into FTS cache"; if (!has_lock) { @@ -2672,7 +2672,7 @@ retry: fts_table.parent = table->name.m_name; - trx = trx_allocate_for_background(); + trx = trx_create(); if (srv_read_only_mode) { trx_start_internal_read_only(trx); } else { @@ -2801,7 +2801,7 @@ fts_update_sync_doc_id( } if (!trx) { - trx = trx_allocate_for_background(); + trx = trx_create(); trx_start_internal(trx); trx->op_info = "setting last FTS document id"; @@ -3042,7 +3042,7 @@ fts_commit_table( ib_rbt_t* rows; dberr_t error = DB_SUCCESS; fts_cache_t* cache = ftt->table->fts->cache; - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); trx_start_internal(trx); @@ -3784,7 +3784,7 @@ fts_doc_fetch_by_doc_id( const char* select_str; doc_id_t write_doc_id; dict_index_t* index; - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); que_t* graph; trx->op_info = "fetching indexed FTS document"; @@ -4126,7 +4126,7 @@ fts_sync_begin( sync->start_time = ut_time(); - sync->trx = trx_allocate_for_background(); + sync->trx = trx_create(); trx_start_internal(sync->trx); if (fts_enable_diag_print) { @@ -5001,7 +5001,7 @@ fts_get_rows_count( ulint count = 0; char table_name[MAX_FULL_NAME_LEN]; - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "fetching FT table rows count"; info = pars_info_create(); @@ -5072,7 +5072,7 @@ fts_update_max_cache_size( trx_t* trx; fts_table_t fts_table; - trx = trx_allocate_for_background(); + trx = trx_create(); FTS_INIT_FTS_TABLE(&fts_table, "CONFIG", FTS_COMMON_TABLE, sync->table); @@ -6376,7 +6376,7 @@ fts_rename_aux_tables_to_hex_format_low( continue; } - trx_bg = trx_allocate_for_background(); + trx_bg = trx_create(); trx_bg->op_info = "Revert half done rename"; trx_bg->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx_bg, TRX_DICT_OP_TABLE); @@ -6618,7 +6618,7 @@ fts_rename_aux_tables_to_hex_format( dict_table_t* parent_table) { dberr_t err; - trx_t* trx_rename = trx_allocate_for_background(); + trx_t* trx_rename = trx_create(); trx_rename->op_info = "Rename aux tables to hex format"; trx_rename->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx_rename, TRX_DICT_OP_TABLE); @@ -6637,7 +6637,7 @@ fts_rename_aux_tables_to_hex_format( /* Corrupting the fts index related to parent table. */ trx_t* trx_corrupt; - trx_corrupt = trx_allocate_for_background(); + trx_corrupt = trx_create(); trx_corrupt->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx_corrupt, TRX_DICT_OP_TABLE); fts_parent_all_index_set_corrupt(trx_corrupt, parent_table); @@ -6697,7 +6697,7 @@ fts_drop_obsolete_aux_table_from_vector( fts_aux_table_t* aux_drop_table; aux_drop_table = static_cast<fts_aux_table_t*>( ib_vector_get(tables, count)); - trx_t* trx_drop = trx_allocate_for_background(); + trx_t* trx_drop = trx_create(); trx_drop->op_info = "Drop obsolete aux tables"; trx_drop->dict_operation_lock_mode = RW_X_LATCH; trx_start_for_ddl(trx_drop, TRX_DICT_OP_TABLE); @@ -7166,7 +7166,7 @@ fts_drop_orphaned_tables(void) mutex_exit(&fil_system.mutex); - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "dropping orphaned FTS tables"; row_mysql_lock_data_dictionary(trx); @@ -7322,7 +7322,7 @@ fts_load_stopword( } if (!trx) { - trx = trx_allocate_for_background(); + trx = trx_create(); if (srv_read_only_mode) { trx_start_internal_read_only(trx); } else { diff --git a/storage/innobase/fts/fts0opt.cc b/storage/innobase/fts/fts0opt.cc index 296494f6a63..da71069a29b 100644 --- a/storage/innobase/fts/fts0opt.cc +++ b/storage/innobase/fts/fts0opt.cc @@ -988,7 +988,7 @@ fts_table_fetch_doc_ids( ut_a(fts_table->type == FTS_COMMON_TABLE); if (!trx) { - trx = trx_allocate_for_background(); + trx = trx_create(); alloc_bk_trx = TRUE; } @@ -1615,7 +1615,7 @@ fts_optimize_create( optim->table = table; - optim->trx = trx_allocate_for_background(); + optim->trx = trx_create(); trx_start_internal(optim->trx); optim->fts_common_table.parent = table->name.m_name; diff --git a/storage/innobase/fts/fts0que.cc b/storage/innobase/fts/fts0que.cc index b9977bd31e5..0be85ba8595 100644 --- a/storage/innobase/fts/fts0que.cc +++ b/storage/innobase/fts/fts0que.cc @@ -3951,7 +3951,7 @@ fts_query( *result = NULL; memset(&query, 0x0, sizeof(query)); - query_trx = trx_allocate_for_background(); + query_trx = trx_create(); query_trx->op_info = "FTS query"; start_time_ms = ut_time_ms(); diff --git a/storage/innobase/handler/i_s.cc b/storage/innobase/handler/i_s.cc index 1e3cd18e069..da1f2ad6547 100644 --- a/storage/innobase/handler/i_s.cc +++ b/storage/innobase/handler/i_s.cc @@ -2944,7 +2944,7 @@ i_s_fts_deleted_generic_fill( deleted = fts_doc_ids_create(); - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "Select for FTS DELETE TABLE"; FTS_INIT_FTS_TABLE(&fts_table, @@ -3477,7 +3477,7 @@ i_s_fts_index_table_fill_selected( fts_result_cache_limit = 8192; ); - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "fetching FTS index nodes"; @@ -3972,7 +3972,7 @@ i_s_fts_config_fill( DBUG_RETURN(0); } - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "Select for FTS CONFIG TABLE"; FTS_INIT_FTS_TABLE(&fts_table, "CONFIG", FTS_COMMON_TABLE, user_table); diff --git a/storage/innobase/include/trx0trx.h b/storage/innobase/include/trx0trx.h index d6e66222211..de4f5d54e42 100644 --- a/storage/innobase/include/trx0trx.h +++ b/storage/innobase/include/trx0trx.h @@ -88,17 +88,9 @@ Creates a transaction object for MySQL. trx_t* trx_allocate_for_mysql(void); /*========================*/ -/********************************************************************//** -Creates a transaction object for background operations by the master thread. -@return own: transaction object */ -trx_t* -trx_allocate_for_background(void); -/*=============================*/ -/** Frees and initialize a transaction object instantinated during recovery. -@param trx trx object to free and initialize during recovery */ -void -trx_free_resurrected(trx_t* trx); +/** @return a trx_t instance from trx_pools. */ +trx_t *trx_create(); /** Free a transaction that was allocated by background or user threads. @param trx trx object to free */ diff --git a/storage/innobase/row/row0ftsort.cc b/storage/innobase/row/row0ftsort.cc index 8edb6a33fea..7fe550b5772 100644 --- a/storage/innobase/row/row0ftsort.cc +++ b/storage/innobase/row/row0ftsort.cc @@ -1595,7 +1595,7 @@ row_fts_merge_insert( /* We use the insert query graph as the dummy graph needed in the row module call */ - trx = trx_allocate_for_background(); + trx = trx_create(); trx_start_if_not_started(trx, true); trx->op_info = "inserting index entries"; diff --git a/storage/innobase/row/row0merge.cc b/storage/innobase/row/row0merge.cc index c6d71ac0cbd..b8e1bc60cba 100644 --- a/storage/innobase/row/row0merge.cc +++ b/storage/innobase/row/row0merge.cc @@ -4066,7 +4066,7 @@ row_merge_drop_temp_indexes(void) /* Load the table definitions that contain partially defined indexes, so that the data dictionary information can be checked when accessing the tablename.ibd files. */ - trx = trx_allocate_for_background(); + trx = trx_create(); trx->op_info = "dropping partially created indexes"; row_mysql_lock_data_dictionary(trx); /* Ensure that this transaction will be rolled back and locks diff --git a/storage/innobase/row/row0mysql.cc b/storage/innobase/row/row0mysql.cc index 28814eb2876..804e06cddf9 100644 --- a/storage/innobase/row/row0mysql.cc +++ b/storage/innobase/row/row0mysql.cc @@ -2717,7 +2717,7 @@ row_drop_table_for_mysql_in_background( dberr_t error; trx_t* trx; - trx = trx_allocate_for_background(); + trx = trx_create(); /* If the original transaction was dropping a table referenced by foreign keys, we must set the following to be able to drop the @@ -2832,7 +2832,7 @@ row_mysql_drop_garbage_tables() mem_heap_t* heap = mem_heap_create(FN_REFLEN); btr_pcur_t pcur; mtr_t mtr; - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); trx->op_info = "dropping garbage tables"; row_mysql_lock_data_dictionary(trx); @@ -4702,7 +4702,7 @@ funct_exit: && table != NULL && (table->space != 0)) { char* orig_name = table->name.m_name; - trx_t* trx_bg = trx_allocate_for_background(); + trx_t* trx_bg = trx_create(); /* If the first fts_rename fails, the trx would be rolled back and committed, we can't use it any more, diff --git a/storage/innobase/row/row0trunc.cc b/storage/innobase/row/row0trunc.cc index b3a996d990a..2d00ed5814e 100644 --- a/storage/innobase/row/row0trunc.cc +++ b/storage/innobase/row/row0trunc.cc @@ -1402,7 +1402,7 @@ row_truncate_update_sys_tables_during_fix_up( ibool reserve_dict_mutex, bool mark_index_corrupted) { - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); trx_set_dict_operation(trx, TRX_DICT_OP_TABLE); diff --git a/storage/innobase/trx/trx0purge.cc b/storage/innobase/trx/trx0purge.cc index e29de063ddc..8a9d2d91792 100644 --- a/storage/innobase/trx/trx0purge.cc +++ b/storage/innobase/trx/trx0purge.cc @@ -138,7 +138,7 @@ purge_graph_build() { ut_a(srv_n_purge_threads > 0); - trx_t* trx = trx_allocate_for_background(); + trx_t* trx = trx_create(); ut_ad(!trx->id); trx->start_time = ut_time(); trx->state = TRX_STATE_ACTIVE; diff --git a/storage/innobase/trx/trx0trx.cc b/storage/innobase/trx/trx0trx.cc index cec24891b0d..a44b96bd4e4 100644 --- a/storage/innobase/trx/trx0trx.cc +++ b/storage/innobase/trx/trx0trx.cc @@ -394,9 +394,7 @@ trx_pool_close() } /** @return a trx_t instance from trx_pools. */ -static -trx_t* -trx_create_low() +trx_t *trx_create() { trx_t* trx = trx_pools->get(); @@ -466,20 +464,6 @@ trx_free(trx_t*& trx) } /********************************************************************//** -Creates a transaction object for background operations by the master thread. -@return own: transaction object */ -trx_t* -trx_allocate_for_background(void) -/*=============================*/ -{ - trx_t* trx; - - trx = trx_create_low(); - - return(trx); -} - -/********************************************************************//** Creates a transaction object for MySQL. @return own: transaction object */ trx_t* @@ -488,7 +472,7 @@ trx_allocate_for_mysql(void) { trx_t* trx; - trx = trx_allocate_for_background(); + trx = trx_create(); mutex_enter(&trx_sys.mutex); @@ -543,18 +527,6 @@ trx_validate_state_before_free(trx_t* trx) assert_trx_is_inactive(trx); } -/** Free and initialize a transaction object instantinated during recovery. -@param trx trx object to free and initialize during recovery */ -void -trx_free_resurrected(trx_t* trx) -{ - trx_validate_state_before_free(trx); - - trx_init(trx); - - trx_free(trx); -} - /** Free a transaction that was allocated by background or user threads. @param trx trx object to free */ void @@ -785,7 +757,7 @@ static void trx_resurrect(trx_undo_t *undo, trx_rseg_t *rseg, return; } - trx_t *trx= trx_allocate_for_background(); + trx_t *trx= trx_create(); trx->state= state; ut_d(trx->start_file= __FILE__); ut_d(trx->start_line= __LINE__); |