Skip to content
Permalink
Browse files
MDEV-15773 - Simplified away trx_free_for_(mysql|background)
  • Loading branch information
Sergey Vojtovich committed Apr 4, 2018
1 parent 0993d6b commit 3d5f7ad
Show file tree
Hide file tree
Showing 19 changed files with 96 additions and 129 deletions.
@@ -1588,7 +1588,7 @@ dict_create_or_check_foreign_constraint_tables(void)

row_mysql_unlock_data_dictionary(trx);

trx_free_for_background(trx);
trx_free(trx);

srv_file_per_table = srv_file_per_table_backup;

@@ -1692,7 +1692,7 @@ dict_create_or_check_sys_virtual()

row_mysql_unlock_data_dictionary(trx);

trx_free_for_background(trx);
trx_free(trx);

srv_file_per_table = srv_file_per_table_backup;

@@ -2356,7 +2356,7 @@ dict_create_or_check_sys_tablespace(void)

row_mysql_unlock_data_dictionary(trx);

trx_free_for_background(trx);
trx_free(trx);

srv_file_per_table = srv_file_per_table_backup;

@@ -444,7 +444,7 @@ dict_table_try_drop_aborted(
}

row_mysql_unlock_data_dictionary(trx);
trx_free_for_background(trx);
trx_free(trx);
}

/**********************************************************************//**
@@ -2046,7 +2046,7 @@ dict_table_remove_from_cache_low(
row_merge_drop_indexes_dict(trx, table->id);
trx_commit_for_mysql(trx);
trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
trx_free(trx);
}

/* Free virtual column template if any */
@@ -914,7 +914,7 @@ dict_update_filepath(

trx_commit_for_mysql(trx);
trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
trx_free(trx);

if (err == DB_SUCCESS) {
/* We just updated SYS_DATAFILES due to the contents in
@@ -976,7 +976,7 @@ dict_replace_tablespace_and_filepath(

trx_commit_for_mysql(trx);
trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
trx_free(trx);

return(err);
}
@@ -333,7 +333,7 @@ dict_stats_exec_sql(
}

if (trx_started) {
trx_free_for_background(trx);
trx_free(trx);
}

return(err);
@@ -2602,7 +2602,7 @@ dict_stats_save(
trx_commit_for_mysql(trx);

end:
trx_free_for_background(trx);
trx_free(trx);

mutex_exit(&dict_sys->mutex);
rw_lock_x_unlock(dict_operation_lock);
@@ -3078,7 +3078,7 @@ dict_stats_fetch_from_ps(

trx_commit_for_mysql(trx);

trx_free_for_background(trx);
trx_free(trx);

if (!index_fetch_arg.stats_were_modified) {
return(DB_STATS_DO_NOT_EXIST);
@@ -552,7 +552,7 @@ fts_load_user_stopword(
mutex_exit(&dict_sys->mutex);
}

trx_free_for_background(trx);
trx_free(trx);
return(ret);
}

@@ -2758,7 +2758,7 @@ fts_cmp_set_sync_doc_id(
}
}

trx_free_for_background(trx);
trx_free(trx);

return(error);
}
@@ -2839,7 +2839,7 @@ fts_update_sync_doc_id(

fts_sql_rollback(trx);
}
trx_free_for_background(trx);
trx_free(trx);
}

return(error);
@@ -3084,7 +3084,7 @@ fts_commit_table(

fts_sql_commit(trx);

trx_free_for_background(trx);
trx_free(trx);

return(error);
}
@@ -3875,7 +3875,7 @@ fts_doc_fetch_by_doc_id(

error = fts_eval_sql(trx, graph);
fts_sql_commit(trx);
trx_free_for_background(trx);
trx_free(trx);

if (!get_doc) {
fts_que_graph_free(graph);
@@ -4271,7 +4271,7 @@ fts_sync_commit(

/* Avoid assertion in trx_free(). */
trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
trx_free(trx);

return(error);
}
@@ -4325,7 +4325,7 @@ fts_sync_rollback(

/* Avoid assertion in trx_free(). */
trx->dict_operation_lock_mode = 0;
trx_free_for_background(trx);
trx_free(trx);
}

/** Run SYNC on the table, i.e., write out data from the cache to the
@@ -5055,7 +5055,7 @@ fts_get_rows_count(

fts_que_graph_free(graph);

trx_free_for_background(trx);
trx_free(trx);

return(count);
}
@@ -5081,7 +5081,7 @@ fts_update_max_cache_size(

fts_sql_commit(trx);

trx_free_for_background(trx);
trx_free(trx);
}
#endif /* FTS_CACHE_SIZE_DEBUG */

@@ -6394,14 +6394,14 @@ fts_rename_aux_tables_to_hex_format_low(
<< table->name << ". Please revert"
" manually.";
fts_sql_rollback(trx_bg);
trx_free_for_background(trx_bg);
trx_free(trx_bg);
/* Continue to clear aux tables' flags2 */
not_rename = true;
continue;
}

fts_sql_commit(trx_bg);
trx_free_for_background(trx_bg);
trx_free(trx_bg);
}

DICT_TF2_FLAG_UNSET(parent_table, DICT_TF2_FTS_AUX_HEX_NAME);
@@ -6643,12 +6643,12 @@ fts_rename_aux_tables_to_hex_format(
fts_parent_all_index_set_corrupt(trx_corrupt, parent_table);
trx_corrupt->dict_operation_lock_mode = 0;
fts_sql_commit(trx_corrupt);
trx_free_for_background(trx_corrupt);
trx_free(trx_corrupt);
} else {
fts_sql_commit(trx_rename);
}

trx_free_for_background(trx_rename);
trx_free(trx_rename);
ib_vector_reset(aux_tables);
}

@@ -6726,7 +6726,7 @@ fts_drop_obsolete_aux_table_from_vector(
fts_sql_commit(trx_drop);
}

trx_free_for_background(trx_drop);
trx_free(trx_drop);
}
}

@@ -7221,7 +7221,7 @@ fts_drop_orphaned_tables(void)

row_mysql_unlock_data_dictionary(trx);

trx_free_for_background(trx);
trx_free(trx);

if (heap != NULL) {
mem_heap_free(heap);
@@ -7402,7 +7402,7 @@ fts_load_stopword(
fts_sql_rollback(trx);
}

trx_free_for_background(trx);
trx_free(trx);
}

if (!cache->stopword_info.cached_stopword) {
@@ -1028,7 +1028,7 @@ fts_table_fetch_doc_ids(
}

if (alloc_bk_trx) {
trx_free_for_background(trx);
trx_free(trx);
}

return(error);
@@ -1740,7 +1740,7 @@ fts_optimize_free(
mem_heap_t* heap = static_cast<mem_heap_t*>(optim->self_heap->arg);

trx_commit_for_mysql(optim->trx);
trx_free_for_background(optim->trx);
trx_free(optim->trx);

fts_doc_ids_free(optim->to_delete);
fts_optimize_graph_free(&optim->graph);
@@ -4120,7 +4120,7 @@ fts_query(
func_exit:
fts_query_free(&query);

trx_free_for_background(query_trx);
trx_free(query_trx);

return(error);
}
@@ -4244,7 +4244,7 @@ innobase_end(handlerton*, ha_panic_function)
if (thd) { // may be UNINSTALL PLUGIN statement
trx_t* trx = thd_to_trx(thd);
if (trx) {
trx_free_for_mysql(trx);
trx_free(trx);
}
}

@@ -5013,7 +5013,7 @@ innobase_close_connection(
} else {
rollback_and_free:
innobase_rollback_trx(trx);
trx_free_for_mysql(trx);
trx_free(trx);
}
}

@@ -12582,7 +12582,7 @@ create_table_info_t::create_table_update_dict()
if (!innobase_fts_load_stopword(innobase_table, NULL, m_thd)) {
dict_table_close(innobase_table, FALSE, FALSE);
srv_active_wake_master_thread();
trx_free_for_mysql(m_trx);
trx_free(m_trx);
DBUG_RETURN(-1);
}
}
@@ -12707,14 +12707,14 @@ ha_innobase::create(

srv_active_wake_master_thread();

trx_free_for_mysql(trx);
trx_free(trx);

DBUG_RETURN(error);

cleanup:
trx_rollback_for_mysql(trx);
row_mysql_unlock_data_dictionary(trx);
trx_free_for_mysql(trx);
trx_free(trx);

DBUG_RETURN(error);
}
@@ -13076,7 +13076,7 @@ ha_innobase::delete_table(

innobase_commit_low(trx);

trx_free_for_mysql(trx);
trx_free(trx);

DBUG_RETURN(convert_error_code_to_mysql(err, 0, NULL));
}
@@ -13149,7 +13149,7 @@ innobase_drop_database(

innobase_commit_low(trx);

trx_free_for_mysql(trx);
trx_free(trx);
}

/*********************************************************************//**
@@ -13276,7 +13276,7 @@ ha_innobase::rename_table(

innobase_commit_low(trx);

trx_free_for_mysql(trx);
trx_free(trx);

if (error == DB_SUCCESS) {
char norm_from[MAX_FULL_NAME_LEN];
@@ -17102,7 +17102,7 @@ innobase_commit_by_xid(
ut_ad(trx->mysql_thd == NULL);
trx_deregister_from_2pc(trx);
ut_ad(!trx->will_lock); /* trx cache requirement */
trx_free_for_background(trx);
trx_free(trx);

return(XA_OK);
} else {
@@ -17132,7 +17132,7 @@ innobase_rollback_by_xid(
int ret = innobase_rollback_trx(trx);
trx_deregister_from_2pc(trx);
ut_ad(!trx->will_lock);
trx_free_for_background(trx);
trx_free(trx);

return(ret);
} else {

0 comments on commit 3d5f7ad

Please sign in to comment.