Skip to content

Commit

Permalink
Remove a constant parameter commit=false
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Oct 2, 2017
1 parent 3c4cff3 commit d6f857d
Show file tree
Hide file tree
Showing 8 changed files with 10 additions and 27 deletions.
10 changes: 2 additions & 8 deletions storage/innobase/dict/dict0crea.cc
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -2551,16 +2552,14 @@ replacing what was there previously.
@param[in] flags Tablespace flags
@param[in] path Tablespace path
@param[in] trx Transaction
@param[in] commit If true, commit the transaction
@return error code or DB_SUCCESS */
dberr_t
dict_replace_tablespace_in_dictionary(
ulint space_id,
const char* name,
ulint flags,
const char* path,
trx_t* trx,
bool commit)
trx_t* trx)
{
if (!srv_sys_tablespaces_open) {
/* Startup procedure is not yet ready for updates. */
Expand Down Expand Up @@ -2609,11 +2608,6 @@ dict_replace_tablespace_in_dictionary(
return(error);
}

if (commit) {
trx->op_info = "committing tablespace and datafile definition";
trx_commit(trx);
}

trx->op_info = "";

return(error);
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/dict/dict0load.cc
Original file line number Diff line number Diff line change
Expand Up @@ -990,7 +990,7 @@ dict_replace_tablespace_and_filepath(
SYS_DATAFILES. Assume the record is also missing in
SYS_TABLESPACES. Insert records into them both. */
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->dict_operation_lock_mode = 0;
Expand Down
4 changes: 2 additions & 2 deletions storage/innobase/fts/fts0fts.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1784,7 +1784,7 @@ fts_create_one_common_table(
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);

if (error == DB_SUCCESS) {
Expand Down Expand Up @@ -2001,7 +2001,7 @@ fts_create_one_index_table(
(DATA_MTYPE_MAX << 16) | DATA_UNSIGNED | DATA_NOT_NULL,
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);

if (error == DB_SUCCESS) {
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/ha_innodb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -11796,7 +11796,7 @@ create_table_info_t::create_table_def()
} else {
if (err == DB_SUCCESS) {
err = row_create_table_for_mysql(
table, m_trx, false,
table, m_trx,
(fil_encryption_t)options->encryption,
(uint32_t)options->encryption_key_id);
}
Expand Down
2 changes: 1 addition & 1 deletion storage/innobase/handler/handler0alter.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4709,7 +4709,7 @@ prepare_inplace_alter_table_dict(
}

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) {
dict_table_t* temp_table;
Expand Down
5 changes: 2 additions & 3 deletions storage/innobase/include/dict0crea.h
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*****************************************************************************
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
the terms of the GNU General Public License as published by the Free Software
Expand Down Expand Up @@ -242,16 +243,14 @@ replacing what was there previously.
@param[in] flags Tablespace flags
@param[in] path Tablespace path
@param[in] trx Transaction
@param[in] commit If true, commit the transaction
@return error code or DB_SUCCESS */
dberr_t
dict_replace_tablespace_in_dictionary(
ulint space_id,
const char* name,
ulint flags,
const char* path,
trx_t* trx,
bool commit);
trx_t* trx);

/** Delete records from SYS_TABLESPACES and SYS_DATAFILES associated
with a particular tablespace ID.
Expand Down
1 change: 0 additions & 1 deletion storage/innobase/include/row0mysql.h
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,6 @@ row_create_table_for_mysql(
(will be freed, or on DB_SUCCESS
added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */
bool commit, /*!< in: if true, commit the transaction */
fil_encryption_t mode, /*!< in: encryption mode */
uint32_t key_id) /*!< in: encryption key_id */
MY_ATTRIBUTE((warn_unused_result));
Expand Down
11 changes: 1 addition & 10 deletions storage/innobase/row/row0mysql.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2368,7 +2368,6 @@ row_create_table_for_mysql(
(will be freed, or on DB_SUCCESS
added to the data dictionary cache) */
trx_t* trx, /*!< in/out: transaction */
bool commit, /*!< in: if true, commit the transaction */
fil_encryption_t mode, /*!< in: encryption mode */
uint32_t key_id) /*!< in: encryption key_id */
{
Expand Down Expand Up @@ -2398,10 +2397,6 @@ row_create_table_for_mysql(
#endif /* !DBUG_OFF */
dict_mem_table_free(table);

if (commit) {
trx_commit_for_mysql(trx);
}

trx->op_info = "";

return(DB_ERROR);
Expand Down Expand Up @@ -2446,7 +2441,7 @@ row_create_table_for_mysql(
err = dict_replace_tablespace_in_dictionary(
table->space, table->name.m_name,
fil_space_get_flags(table->space),
path, trx, commit);
path, trx);

ut_free(path);

Expand All @@ -2472,10 +2467,6 @@ row_create_table_for_mysql(
DICT_ERR_IGNORE_NONE)) {

dict_table_close_and_drop(trx, table);

if (commit) {
trx_commit_for_mysql(trx);
}
} else {
dict_mem_table_free(table);
}
Expand Down

0 comments on commit d6f857d

Please sign in to comment.