Commit aa2f263e authored by Marko Mäkelä's avatar Marko Mäkelä

Cleanup: Remove constant parameters async=false, index_name=NULL

parent 74bd3683
......@@ -157,8 +157,6 @@ synchronized defragmentation. */
os_event_t
btr_defragment_add_index(
dict_index_t* index, /*!< index to be added */
bool async, /*!< whether this is an async
defragmentation */
dberr_t* err) /*!< out: error code */
{
mtr_t mtr;
......@@ -191,10 +189,7 @@ btr_defragment_add_index(
return NULL;
}
btr_pcur_t* pcur = btr_pcur_create_for_mysql();
os_event_t event = NULL;
if (!async) {
event = os_event_create(0);
}
os_event_t event = os_event_create(0);
btr_pcur_open_at_index_side(true, index, BTR_SEARCH_LEAF, pcur,
true, 0, &mtr);
btr_pcur_move_to_next(pcur, &mtr);
......
......@@ -14705,25 +14705,14 @@ ha_innobase::analyze(
/*****************************************************************//**
Defragment table.
@return error number */
UNIV_INTERN
int
ha_innobase::defragment_table(
/*==========================*/
const char* name, /*!< in: table name */
const char* index_name, /*!< in: index name */
bool async) /*!< in: whether to wait until finish */
inline int ha_innobase::defragment_table(const char *name)
{
char norm_name[FN_REFLEN];
dict_table_t* table = NULL;
dict_index_t* index = NULL;
ibool one_index = (index_name != 0);
int ret = 0;
dberr_t err = DB_SUCCESS;
if (!srv_defragment) {
return ER_FEATURE_DISABLED;
}
normalize_table_name(norm_name, name);
table = dict_table_open_on_name(norm_name, FALSE,
......@@ -14751,10 +14740,6 @@ ha_innobase::defragment_table(
continue;
}
if (one_index && strcasecmp(index_name, index->name) != 0) {
continue;
}
if (btr_defragment_find_index(index)) {
// We borrow this error code. When the same index is
// already in the defragmentation queue, issue another
......@@ -14770,7 +14755,7 @@ ha_innobase::defragment_table(
break;
}
os_event_t event = btr_defragment_add_index(index, async, &err);
os_event_t event = btr_defragment_add_index(index, &err);
if (err != DB_SUCCESS) {
push_warning_printf(
......@@ -14786,7 +14771,7 @@ ha_innobase::defragment_table(
break;
}
if (!async && event) {
if (event) {
while(os_event_wait_time(event, 1000000)) {
if (thd_killed(current_thd)) {
btr_defragment_remove_index(index);
......@@ -14800,19 +14785,9 @@ ha_innobase::defragment_table(
if (ret) {
break;
}
if (one_index) {
one_index = FALSE;
break;
}
}
dict_table_close(table, FALSE, FALSE);
if (ret == 0 && one_index) {
ret = ER_NO_SUCH_INDEX;
}
return ret;
}
......@@ -14838,9 +14813,7 @@ ha_innobase::optimize(
bool try_alter = true;
if (!m_prebuilt->table->is_temporary() && srv_defragment) {
int err;
err = defragment_table(m_prebuilt->table->name.m_name, NULL, false);
int err = defragment_table(m_prebuilt->table->name.m_name);
if (err == 0) {
try_alter = false;
......
......@@ -219,8 +219,7 @@ class ha_innobase: public handler
int delete_table(const char *name);
int rename_table(const char* from, const char* to);
int defragment_table(const char* name, const char* index_name,
bool async);
inline int defragment_table(const char* name);
int check(THD* thd, HA_CHECK_OPT* check_opt);
char* update_table_comment(const char* comment);
......
......@@ -64,8 +64,6 @@ is a synchronized defragmentation. */
os_event_t
btr_defragment_add_index(
dict_index_t* index, /*!< index to be added */
bool async, /*!< whether this is an async
defragmentation */
dberr_t* err); /*!< out: error code */
/******************************************************************//**
When table is dropped, this function is called to mark a table as removed in
......
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