Commit 7bd225e1 authored by Yuchen Pei's avatar Yuchen Pei

MDEV-30920 Remove need_lock and table from spider_close_sys_table()

They became obsolete after commit cfd145fa:

commit cfd145fa
Author: Nayuta Yanagisawa <nayuta.yanagisawa@hey.com>
Date:   Fri Jan 28 01:03:06 2022 +0900

    MDEV-27641 Spider: remove #if MYSQL_VERSION_ID < ${VERSION}
parent 5a1f7522
......@@ -8597,7 +8597,6 @@ int ha_spider::create(
SPIDER_TRX *trx;
TABLE *table_tables = NULL;
SPIDER_Open_tables_backup open_tables_backup;
bool need_lock = FALSE;
DBUG_ENTER("ha_spider::create");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider name=%s", name));
......@@ -8675,7 +8674,7 @@ int ha_spider::create(
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
......@@ -8692,8 +8691,7 @@ int ha_spider::create(
) {
goto error;
}
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
} else if (
sql_command == SQLCOM_ALTER_TABLE
......@@ -8726,11 +8724,10 @@ int ha_spider::create(
) &&
memcmp(name + strlen(name) - 5, "#TMP#", 5)
) {
need_lock = TRUE;
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
......@@ -8740,8 +8737,7 @@ int ha_spider::create(
) {
goto error;
}
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
}
}
......@@ -8770,8 +8766,7 @@ int ha_spider::create(
error:
if (table_tables)
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(current_thd, &open_tables_backup);
if (tmp_share.lgtm_tblhnd_share)
spider_free_lgtm_tblhnd_share_alloc(tmp_share.lgtm_tblhnd_share, FALSE);
if (tmp_share.static_key_cardinality)
......@@ -8843,7 +8838,6 @@ int ha_spider::rename_table(
SPIDER_ALTER_TABLE *alter_table_from, *alter_table_to;
SPIDER_LGTM_TBLHND_SHARE *from_lgtm_tblhnd_share, *to_lgtm_tblhnd_share;
SPIDER_Open_tables_backup open_tables_backup;
bool need_lock = FALSE;
DBUG_ENTER("ha_spider::rename_table");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider from=%s", from));
......@@ -8875,7 +8869,7 @@ int ha_spider::rename_table(
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
......@@ -8886,8 +8880,7 @@ int ha_spider::rename_table(
) {
goto error;
}
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
/* release table mon list */
......@@ -8929,21 +8922,10 @@ int ha_spider::rename_table(
DBUG_PRINT("info",
("spider alter_info.flags: %llu alter_info.partition_flags: %lu",
thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags));
if (
(thd->lex->alter_info.partition_flags &
(
SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP |
SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE |
SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD
)
)
)
need_lock = TRUE;
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
......@@ -8972,8 +8954,7 @@ int ha_spider::rename_table(
goto error;
}
}
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
if (!alter_table_from->now_create)
......@@ -9031,8 +9012,7 @@ int ha_spider::rename_table(
error:
if (table_tables)
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(current_thd, &open_tables_backup);
pthread_mutex_lock(&spider_lgtm_tblhnd_share_mutex);
to_lgtm_tblhnd_share = spider_get_lgtm_tblhnd_share(
to, to_len, to_hash_value, TRUE, FALSE, &tmp_error_num);
......@@ -9052,7 +9032,6 @@ int ha_spider::delete_table(
uint sql_command = thd_sql_command(thd);
SPIDER_ALTER_TABLE *alter_table;
SPIDER_Open_tables_backup open_tables_backup;
bool need_lock = FALSE;
DBUG_ENTER("ha_spider::delete_table");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider name=%s", name));
......@@ -9098,28 +9077,16 @@ int ha_spider::delete_table(
DBUG_PRINT("info",
("spider alter_info.flags: %llu alter_info.partition_flags: %lu",
thd->lex->alter_info.flags, thd->lex->alter_info.partition_flags));
if (
sql_command == SQLCOM_ALTER_TABLE &&
(thd->lex->alter_info.partition_flags &
(
SPIDER_ALTER_PARTITION_ADD | SPIDER_ALTER_PARTITION_DROP |
SPIDER_ALTER_PARTITION_COALESCE | SPIDER_ALTER_PARTITION_REORGANIZE |
SPIDER_ALTER_PARTITION_TABLE_REORG | SPIDER_ALTER_PARTITION_REBUILD
)
)
)
need_lock = TRUE;
if ((error_num = spider_sys_delete_table_sts(
current_thd, name, name_len, need_lock)))
current_thd, name, name_len)))
goto error;
if ((error_num = spider_sys_delete_table_crd(
current_thd, name, name_len, need_lock)))
current_thd, name, name_len)))
goto error;
if (
!(table_tables = spider_open_sys_table(
current_thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, need_lock,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
goto error;
......@@ -9130,8 +9097,7 @@ int ha_spider::delete_table(
) {
goto error;
}
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(current_thd, &open_tables_backup);
table_tables = NULL;
/* release table mon list */
......@@ -9155,8 +9121,7 @@ int ha_spider::delete_table(
error:
if (table_tables)
spider_close_sys_table(current_thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(current_thd, &open_tables_backup);
DBUG_RETURN(error_num);
}
......
......@@ -355,7 +355,7 @@ int spider_udf_get_copy_tgt_tables(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
need_lock, &error_num))
&error_num))
) {
my_error(error_num, MYF(0));
goto error;
......@@ -543,8 +543,7 @@ int spider_udf_get_copy_tgt_tables(
error_num = spider_sys_index_next_same(table_tables, table_key);
} while (error_num == 0);
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
if (!copy_tables->table_conn[0])
......@@ -566,8 +565,7 @@ int spider_udf_get_copy_tgt_tables(
error:
if (table_tables)
spider_close_sys_table(thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
if (table_conn)
{
spider_free_tmp_dbton_share(tmp_share);
......
......@@ -267,7 +267,7 @@ int spider_get_ping_table_mon(
!(table_link_mon = spider_open_sys_table(
thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR,
SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup,
need_lock, &error_num))
&error_num))
) {
my_error(error_num, MYF(0));
goto error;
......@@ -386,8 +386,7 @@ int spider_get_ping_table_mon(
error_num = spider_sys_index_next_same(table_link_mon, table_key);
} while (error_num == 0);
spider_sys_index_end(table_link_mon);
spider_close_sys_table(thd, table_link_mon,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
table_link_mon = NULL;
table_mon_list->list_size = list_size;
......@@ -403,8 +402,7 @@ int spider_get_ping_table_mon(
error:
if (table_link_mon)
spider_close_sys_table(thd, table_link_mon,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
table_mon = table_mon_list->first;
table_mon_list->first = NULL;
table_mon_list->current = NULL;
......@@ -474,7 +472,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup, need_lock,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
error_num))
) {
my_error(*error_num, MYF(0));
......@@ -512,8 +510,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
table_tables->file->print_error(*error_num, MYF(0));
goto error;
}
spider_close_sys_table(thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
if (
......@@ -576,8 +573,7 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_tgt(
error_caller_mutex_init:
error:
if (table_tables)
spider_close_sys_table(thd, table_tables,
&open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
free_root(&mem_root, MYF(0));
if (table_mon_list)
{
......@@ -791,11 +787,10 @@ int spider_get_ping_table_gtid_pos(
goto error_sys_index_end;
}
#ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP
spider_close_sys_table(thd, table_gtid_pos,
spider_sys_close_table(thd, table_gtid_pos,
&open_tables_backup_gtid_pos, need_lock);
#endif
spider_close_sys_table(thd, table_tables, &open_tables_backup_tables,
need_lock);
spider_sys_close_table(thd, &open_tables_backup_tables);
DBUG_RETURN(0);
......@@ -806,13 +801,12 @@ int spider_get_ping_table_gtid_pos(
error_sys_index_end:
error_get_sys_table_by_idx:
#ifdef SPIDER_REQUIRE_DEFINE_FOR_SECONDARY_OPEN_TABLES_BACKUP
spider_close_sys_table(thd, table_gtid_pos,
spider_sys_close_table(thd, table_gtid_pos,
&open_tables_backup_gtid_pos,
need_lock);
error_open_table_gtid_pos:
#endif
spider_close_sys_table(thd, table_tables, &open_tables_backup_tables,
need_lock);
spider_sys_close_table(thd, &open_tables_backup_tables);
error_open_table_tables:
DBUG_RETURN(error_num);
}
......@@ -833,7 +827,7 @@ int spider_init_ping_table_mon_cache(
!(table_link_mon = spider_open_sys_table(
thd, SPIDER_SYS_LINK_MON_TABLE_NAME_STR,
SPIDER_SYS_LINK_MON_TABLE_NAME_LEN, FALSE, &open_tables_backup,
need_lock, &error_num))
&error_num))
) {
my_error(error_num, MYF(0));
goto error_open_sys_table;
......@@ -921,7 +915,7 @@ int spider_init_ping_table_mon_cache(
spider_mon_table_cache_version = spider_mon_table_cache_version_req;
}
pthread_mutex_unlock(&spider_mon_table_cache_mutex);
spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
error_push_dynamic:
......@@ -930,7 +924,7 @@ int spider_init_ping_table_mon_cache(
spider_sys_index_end(table_link_mon);
error_sys_index_first:
pthread_mutex_unlock(&spider_mon_table_cache_mutex);
spider_close_sys_table(thd, table_link_mon, &open_tables_backup, need_lock);
spider_sys_close_table(thd, &open_tables_backup);
error_open_sys_table:
DBUG_RETURN(error_num);
}
......@@ -1223,9 +1217,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
SPIDER_LINK_STATUS_NG, TRUE);
SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
/*
......@@ -1296,9 +1290,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
SPIDER_LINK_STATUS_NG, TRUE);
SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
/*
......@@ -1359,9 +1353,9 @@ long long spider_ping_table_body(
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_update_tables_link_status(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx,
SPIDER_LINK_STATUS_NG, TRUE);
SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(trx->thd,
conv_name.c_ptr(), conv_name_length, link_idx, TRUE);
conv_name.c_ptr(), conv_name_length, link_idx);
status_changed_to_ng = TRUE;
}
/*
......@@ -1715,9 +1709,9 @@ int spider_ping_table_mon_from_table(
link_idx));
share->link_statuses[link_idx] = SPIDER_LINK_STATUS_NG;
spider_sys_update_tables_link_status(thd, conv_name,
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG, need_lock);
conv_name_length, link_idx, SPIDER_LINK_STATUS_NG);
spider_sys_log_tables_link_failed(thd, conv_name,
conv_name_length, link_idx, need_lock);
conv_name_length, link_idx);
}
/*
pthread_mutex_unlock(&table_mon_list->update_status_mutex);
......
This diff is collapsed.
......@@ -92,17 +92,9 @@ TABLE *spider_open_sys_table(
int table_name_length,
bool write,
SPIDER_Open_tables_backup *open_tables_backup,
bool need_lock,
int *error_num
);
void spider_close_sys_table(
THD *thd,
TABLE *table,
SPIDER_Open_tables_backup *open_tables_backup,
bool need_lock
);
bool spider_sys_open_and_lock_tables(
THD *thd,
TABLE_LIST **tables,
......@@ -487,24 +479,21 @@ int spider_sys_update_tables_link_status(
char *name,
uint name_length,
int link_idx,
long link_status,
bool need_lock
long link_status
);
int spider_sys_log_tables_link_failed(
THD *thd,
char *name,
uint name_length,
int link_idx,
bool need_lock
int link_idx
);
int spider_sys_log_xa_failed(
THD *thd,
XID *xid,
SPIDER_CONN *conn,
const char *status,
bool need_lock
const char *status
);
int spider_get_sys_link_mon_key(
......@@ -537,8 +526,7 @@ int spider_sys_insert_or_update_table_sts(
THD *thd,
const char *name,
uint name_length,
ha_statistics *stat,
bool need_lock
ha_statistics *stat
);
int spider_sys_insert_or_update_table_crd(
......@@ -546,30 +534,26 @@ int spider_sys_insert_or_update_table_crd(
const char *name,
uint name_length,
longlong *cardinality,
uint number_of_keys,
bool need_lock
uint number_of_keys
);
int spider_sys_delete_table_sts(
THD *thd,
const char *name,
uint name_length,
bool need_lock
uint name_length
);
int spider_sys_delete_table_crd(
THD *thd,
const char *name,
uint name_length,
bool need_lock
uint name_length
);
int spider_sys_get_table_sts(
THD *thd,
const char *name,
uint name_length,
ha_statistics *stat,
bool need_lock
ha_statistics *stat
);
int spider_sys_get_table_crd(
......@@ -577,8 +561,7 @@ int spider_sys_get_table_crd(
const char *name,
uint name_length,
longlong *cardinality,
uint number_of_keys,
bool need_lock
uint number_of_keys
);
int spider_sys_replace(
......
......@@ -4688,7 +4688,7 @@ SPIDER_SHARE *spider_get_share(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
FALSE, error_num))
error_num))
) {
for (roop_count = 0;
roop_count < (int) spider_udf_table_mon_mutex_count;
......@@ -4724,8 +4724,7 @@ SPIDER_SHARE *spider_get_share(
share->init_error_time = (time_t) time((time_t*) 0);
share->init = TRUE;
spider_free_share(share);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
goto error_open_sys_table;
}
......@@ -4734,8 +4733,7 @@ SPIDER_SHARE *spider_get_share(
sizeof(long) * share->all_link_count);
share->link_status_init = TRUE;
}
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
}
share->have_recovery_link = spider_conn_check_recovery_link(share);
......@@ -5157,7 +5155,7 @@ SPIDER_SHARE *spider_get_share(
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, FALSE, &open_tables_backup,
FALSE, error_num))
error_num))
) {
for (roop_count = 0;
roop_count < (int) spider_udf_table_mon_mutex_count;
......@@ -5187,8 +5185,7 @@ SPIDER_SHARE *spider_get_share(
}
pthread_mutex_unlock(&share->mutex);
spider_free_share(share);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
goto error_open_sys_table;
}
......@@ -5197,8 +5194,7 @@ SPIDER_SHARE *spider_get_share(
sizeof(long) * share->all_link_count);
share->link_status_init = TRUE;
}
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
table_tables = NULL;
}
share->have_recovery_link = spider_conn_check_recovery_link(share);
......@@ -5620,8 +5616,7 @@ int spider_free_share(
thd,
share->lgtm_tblhnd_share->table_name,
share->lgtm_tblhnd_share->table_name_length,
&share->stat,
FALSE
&share->stat
);
}
if (
......@@ -5642,8 +5637,7 @@ int spider_free_share(
share->lgtm_tblhnd_share->table_name,
share->lgtm_tblhnd_share->table_name_length,
share->cardinality,
share->table_share->fields,
FALSE
share->table_share->fields
);
}
spider_free_share_alloc(share);
......@@ -5950,7 +5944,7 @@ int spider_open_all_tables(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, TRUE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
)
DBUG_RETURN(error_num);
......@@ -5960,12 +5954,10 @@ int spider_open_all_tables(
if (error_num != HA_ERR_KEY_NOT_FOUND && error_num != HA_ERR_END_OF_FILE)
{
table_tables->file->print_error(error_num, MYF(0));
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(error_num);
} else {
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
}
}
......@@ -5996,8 +5988,7 @@ int spider_open_all_tables(
))
) {
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
DBUG_RETURN(error_num);
......@@ -6020,8 +6011,7 @@ int spider_open_all_tables(
(error_num = spider_create_tmp_dbton_share(&tmp_share))
) {
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
DBUG_RETURN(error_num);
......@@ -6032,8 +6022,7 @@ int spider_open_all_tables(
NULL, FALSE, FALSE, &error_num)))
{
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6058,8 +6047,7 @@ int spider_open_all_tables(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6077,8 +6065,7 @@ int spider_open_all_tables(
if (!(spider = new ha_spider()))
{
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6104,8 +6091,7 @@ int spider_open_all_tables(
) {
delete spider;
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6132,8 +6118,7 @@ int spider_open_all_tables(
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6148,8 +6133,7 @@ int spider_open_all_tables(
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6175,8 +6159,7 @@ int spider_open_all_tables(
spider_free(trx, share, MYF(0));
delete spider;
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
spider_free_tmp_dbton_share(&tmp_share);
spider_free_tmp_share_alloc(&tmp_share);
free_root(&mem_root, MYF(0));
......@@ -6191,8 +6174,7 @@ int spider_open_all_tables(
free_root(&mem_root, MYF(0));
spider_sys_index_end(table_tables);
spider_close_sys_table(thd, table_tables,
&open_tables_backup, TRUE);
spider_sys_close_table(thd, &open_tables_backup);
DBUG_RETURN(0);
}
......@@ -7144,8 +7126,7 @@ int spider_get_sts(
current_thd,
share->lgtm_tblhnd_share->table_name,
share->lgtm_tblhnd_share->table_name_length,
&share->stat,
FALSE
&share->stat
);
if (
!error_num ||
......@@ -7279,8 +7260,7 @@ int spider_get_crd(
share->lgtm_tblhnd_share->table_name,
share->lgtm_tblhnd_share->table_name_length,
share->cardinality,
table->s->fields,
FALSE
table->s->fields
);
if (
!error_num ||
......@@ -8521,7 +8501,7 @@ int spider_discover_table_structure(
if (
(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
if (thd->lex->create_info.or_replace())
......@@ -8533,8 +8513,7 @@ int spider_discover_table_structure(
{
error_num = spider_insert_tables(table_tables, spider_share);
}
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
}
}
......@@ -8607,7 +8586,7 @@ int spider_discover_table_structure(
if (
!(table_tables = spider_open_sys_table(
thd, SPIDER_SYS_TABLES_TABLE_NAME_STR,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup, FALSE,
SPIDER_SYS_TABLES_TABLE_NAME_LEN, TRUE, &open_tables_backup,
&error_num))
) {
DBUG_RETURN(error_num);
......@@ -8682,8 +8661,7 @@ int spider_discover_table_structure(
break;
}
}
spider_close_sys_table(thd, table_tables,
&open_tables_backup, FALSE);
spider_sys_close_table(thd, &open_tables_backup);
}
}
......
This diff is collapsed.
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