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