Commit d1be7f72 authored by marko's avatar marko

branches/zip: Remove trx->sync_cb. Call dict_rename_indexes() directly

from ha_innobase::add_index().

dict_rename_indexes(): Remove the redundant parameter commit_flag.
parent 0d6bfcb5
...@@ -4682,14 +4682,12 @@ Add the indexes to SYS_INDEX. */ ...@@ -4682,14 +4682,12 @@ Add the indexes to SYS_INDEX. */
ulint ulint
dict_rename_indexes( dict_rename_indexes(
/*================*/ /*================*/
trx_t* trx, /* in: transaction */ trx_t* trx) /* in: transaction */
ibool commit_flag) /* in: TRUE=commit, FALSE=rollback */
{ {
dict_redo_t* dict_redo; dict_redo_t* dict_redo;
ulint err = DB_SUCCESS; ulint err = DB_SUCCESS;
ut_a(trx->dict_redo_list); ut_a(trx->dict_redo_list);
ut_a(commit_flag);
dict_redo = UT_LIST_GET_FIRST(*trx->dict_redo_list); dict_redo = UT_LIST_GET_FIRST(*trx->dict_redo_list);
......
...@@ -8369,7 +8369,6 @@ err_exit: ...@@ -8369,7 +8369,6 @@ err_exit:
index_defs = innobase_create_key_def( index_defs = innobase_create_key_def(
trx, innodb_table, heap, key_info, num_of_idx); trx, innodb_table, heap, key_info, num_of_idx);
ut_a(!trx->sync_cb);
ut_a(!trx->dict_redo_list); ut_a(!trx->dict_redo_list);
/* If a new primary key is defined for the table we need /* If a new primary key is defined for the table we need
...@@ -8398,7 +8397,6 @@ err_exit: ...@@ -8398,7 +8397,6 @@ err_exit:
} }
} else { } else {
dict_redo_create_list(trx); dict_redo_create_list(trx);
trx->sync_cb = dict_rename_indexes;
} }
/* Allocate memory for dictionary index definitions */ /* Allocate memory for dictionary index definitions */
...@@ -8559,9 +8557,12 @@ error_handling: ...@@ -8559,9 +8557,12 @@ error_handling:
func_exit: func_exit:
mem_heap_free(heap); mem_heap_free(heap);
ut_ad(new_primary || trx->dict_redo_list); if (!new_primary) {
ut_ad(!new_primary || !trx->dict_redo_list); dict_rename_indexes(trx);
innobase_commit_low(trx); }
ut_ad(!trx->dict_redo_list);
trx_commit_for_mysql(trx);
if (dict_locked) { if (dict_locked) {
row_mysql_unlock_data_dictionary(trx); row_mysql_unlock_data_dictionary(trx);
......
...@@ -1115,8 +1115,7 @@ Add the indexes to SYS_INDEX. */ ...@@ -1115,8 +1115,7 @@ Add the indexes to SYS_INDEX. */
ulint ulint
dict_rename_indexes( dict_rename_indexes(
/*================*/ /*================*/
trx_t* trx, /* in: transaction */ trx_t* trx); /* in/out: transaction */
ibool commit_flag); /* in: TRUE=commit, FALSE=rollback */
/************************************************************************** /**************************************************************************
Remove the index from the transaction's REDO list.*/ Remove the index from the transaction's REDO list.*/
......
...@@ -462,18 +462,13 @@ struct trx_struct{ ...@@ -462,18 +462,13 @@ struct trx_struct{
may need to be dropped in crash may need to be dropped in crash
recovery. */ recovery. */
dict_undo_list_t* dict_undo_list_t*
dict_undo_list; /* List of undo records are created dict_undo_list; /* List of undo records created
during recovery.*/ during recovery. */
dict_redo_list_t* dict_redo_list_t*
dict_redo_list; /* List of indexes created by this dict_redo_list; /* List of indexes created by this
transaction.*/ transaction. */
ulint (*sync_cb)(trx_t*, ibool);
/* Transaction synchronization
callback, if ibool parameter is TRUE
then callback invoked for commit else
rollback.*/
dulint table_id; /* Table to drop iff dict_operation dulint table_id; /* Table to drop iff dict_operation
is TRUE.*/ is TRUE. */
/*------------------------------*/ /*------------------------------*/
unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */ unsigned duplicates:2; /* TRX_DUP_IGNORE | TRX_DUP_REPLACE */
unsigned active_trans:2; /* 1 - if a transaction in MySQL unsigned active_trans:2; /* 1 - if a transaction in MySQL
......
...@@ -101,7 +101,6 @@ trx_create( ...@@ -101,7 +101,6 @@ trx_create(
trx->table_id = ut_dulint_zero; trx->table_id = ut_dulint_zero;
trx->dict_undo_list = NULL; trx->dict_undo_list = NULL;
trx->dict_redo_list = NULL; trx->dict_redo_list = NULL;
trx->sync_cb = NULL;
trx->mysql_thd = NULL; trx->mysql_thd = NULL;
trx->mysql_query_str = NULL; trx->mysql_query_str = NULL;
...@@ -1534,14 +1533,6 @@ trx_commit_for_mysql( ...@@ -1534,14 +1533,6 @@ trx_commit_for_mysql(
trx_start_if_not_started(trx); trx_start_if_not_started(trx);
if (trx->sync_cb) {
ulint err;
err = trx->sync_cb(trx, TRUE);
ut_a(err == DB_SUCCESS);
trx->sync_cb = NULL;
}
trx->op_info = "committing"; trx->op_info = "committing";
mutex_enter(&kernel_mutex); mutex_enter(&kernel_mutex);
......
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