Remove a constant parameter commit=false

This commit is contained in:
Marko Mäkelä 2017-10-02 11:27:53 +03:00
parent 3c4cff3357
commit d6f857ddbc
8 changed files with 10 additions and 27 deletions

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -2551,7 +2552,6 @@ replacing what was there previously.
@param[in] flags Tablespace flags @param[in] flags Tablespace flags
@param[in] path Tablespace path @param[in] path Tablespace path
@param[in] trx Transaction @param[in] trx Transaction
@param[in] commit If true, commit the transaction
@return error code or DB_SUCCESS */ @return error code or DB_SUCCESS */
dberr_t dberr_t
dict_replace_tablespace_in_dictionary( dict_replace_tablespace_in_dictionary(
@ -2559,8 +2559,7 @@ dict_replace_tablespace_in_dictionary(
const char* name, const char* name,
ulint flags, ulint flags,
const char* path, const char* path,
trx_t* trx, trx_t* trx)
bool commit)
{ {
if (!srv_sys_tablespaces_open) { if (!srv_sys_tablespaces_open) {
/* Startup procedure is not yet ready for updates. */ /* Startup procedure is not yet ready for updates. */
@ -2609,11 +2608,6 @@ dict_replace_tablespace_in_dictionary(
return(error); return(error);
} }
if (commit) {
trx->op_info = "committing tablespace and datafile definition";
trx_commit(trx);
}
trx->op_info = ""; trx->op_info = "";
return(error); return(error);

View File

@ -990,7 +990,7 @@ dict_replace_tablespace_and_filepath(
SYS_DATAFILES. Assume the record is also missing in SYS_DATAFILES. Assume the record is also missing in
SYS_TABLESPACES. Insert records into them both. */ SYS_TABLESPACES. Insert records into them both. */
err = dict_replace_tablespace_in_dictionary( err = dict_replace_tablespace_in_dictionary(
space_id, name, fsp_flags, filepath, trx, false); space_id, name, fsp_flags, filepath, trx);
trx_commit_for_mysql(trx); trx_commit_for_mysql(trx);
trx->dict_operation_lock_mode = 0; trx->dict_operation_lock_mode = 0;

View File

@ -1784,7 +1784,7 @@ fts_create_one_common_table(
FTS_CONFIG_TABLE_VALUE_COL_LEN); FTS_CONFIG_TABLE_VALUE_COL_LEN);
} }
error = row_create_table_for_mysql(new_table, trx, false, error = row_create_table_for_mysql(new_table, trx,
FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY); FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {
@ -2001,7 +2001,7 @@ fts_create_one_index_table(
(DATA_MTYPE_MAX << 16) | DATA_UNSIGNED | DATA_NOT_NULL, (DATA_MTYPE_MAX << 16) | DATA_UNSIGNED | DATA_NOT_NULL,
FTS_INDEX_ILIST_LEN); FTS_INDEX_ILIST_LEN);
error = row_create_table_for_mysql(new_table, trx, false, error = row_create_table_for_mysql(new_table, trx,
FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY); FIL_ENCRYPTION_DEFAULT, FIL_DEFAULT_ENCRYPTION_KEY);
if (error == DB_SUCCESS) { if (error == DB_SUCCESS) {

View File

@ -11796,7 +11796,7 @@ err_col:
} else { } else {
if (err == DB_SUCCESS) { if (err == DB_SUCCESS) {
err = row_create_table_for_mysql( err = row_create_table_for_mysql(
table, m_trx, false, table, m_trx,
(fil_encryption_t)options->encryption, (fil_encryption_t)options->encryption,
(uint32_t)options->encryption_key_id); (uint32_t)options->encryption_key_id);
} }

View File

@ -4709,7 +4709,7 @@ prepare_inplace_alter_table_dict(
} }
error = row_create_table_for_mysql( error = row_create_table_for_mysql(
ctx->new_table, ctx->trx, false, mode, key_id); ctx->new_table, ctx->trx, mode, key_id);
switch (error) { switch (error) {
dict_table_t* temp_table; dict_table_t* temp_table;

View File

@ -1,6 +1,7 @@
/***************************************************************************** /*****************************************************************************
Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved. Copyright (c) 1996, 2016, Oracle and/or its affiliates. All Rights Reserved.
Copyright (c) 2017, MariaDB Corporation.
This program is free software; you can redistribute it and/or modify it under This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software the terms of the GNU General Public License as published by the Free Software
@ -242,7 +243,6 @@ replacing what was there previously.
@param[in] flags Tablespace flags @param[in] flags Tablespace flags
@param[in] path Tablespace path @param[in] path Tablespace path
@param[in] trx Transaction @param[in] trx Transaction
@param[in] commit If true, commit the transaction
@return error code or DB_SUCCESS */ @return error code or DB_SUCCESS */
dberr_t dberr_t
dict_replace_tablespace_in_dictionary( dict_replace_tablespace_in_dictionary(
@ -250,8 +250,7 @@ dict_replace_tablespace_in_dictionary(
const char* name, const char* name,
ulint flags, ulint flags,
const char* path, const char* path,
trx_t* trx, trx_t* trx);
bool commit);
/** Delete records from SYS_TABLESPACES and SYS_DATAFILES associated /** Delete records from SYS_TABLESPACES and SYS_DATAFILES associated
with a particular tablespace ID. with a particular tablespace ID.

View File

@ -352,7 +352,6 @@ row_create_table_for_mysql(
(will be freed, or on DB_SUCCESS (will be freed, or on DB_SUCCESS
added to the data dictionary cache) */ added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */ trx_t* trx, /*!< in/out: transaction */
bool commit, /*!< in: if true, commit the transaction */
fil_encryption_t mode, /*!< in: encryption mode */ fil_encryption_t mode, /*!< in: encryption mode */
uint32_t key_id) /*!< in: encryption key_id */ uint32_t key_id) /*!< in: encryption key_id */
MY_ATTRIBUTE((warn_unused_result)); MY_ATTRIBUTE((warn_unused_result));

View File

@ -2368,7 +2368,6 @@ row_create_table_for_mysql(
(will be freed, or on DB_SUCCESS (will be freed, or on DB_SUCCESS
added to the data dictionary cache) */ added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */ trx_t* trx, /*!< in/out: transaction */
bool commit, /*!< in: if true, commit the transaction */
fil_encryption_t mode, /*!< in: encryption mode */ fil_encryption_t mode, /*!< in: encryption mode */
uint32_t key_id) /*!< in: encryption key_id */ uint32_t key_id) /*!< in: encryption key_id */
{ {
@ -2398,10 +2397,6 @@ err_exit:
#endif /* !DBUG_OFF */ #endif /* !DBUG_OFF */
dict_mem_table_free(table); dict_mem_table_free(table);
if (commit) {
trx_commit_for_mysql(trx);
}
trx->op_info = ""; trx->op_info = "";
return(DB_ERROR); return(DB_ERROR);
@ -2446,7 +2441,7 @@ err_exit:
err = dict_replace_tablespace_in_dictionary( err = dict_replace_tablespace_in_dictionary(
table->space, table->name.m_name, table->space, table->name.m_name,
fil_space_get_flags(table->space), fil_space_get_flags(table->space),
path, trx, commit); path, trx);
ut_free(path); ut_free(path);
@ -2472,10 +2467,6 @@ err_exit:
DICT_ERR_IGNORE_NONE)) { DICT_ERR_IGNORE_NONE)) {
dict_table_close_and_drop(trx, table); dict_table_close_and_drop(trx, table);
if (commit) {
trx_commit_for_mysql(trx);
}
} else { } else {
dict_mem_table_free(table); dict_mem_table_free(table);
} }