mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-27648 Spider: remove in #ifdef HASH_UPDATE_WITH_HASH_VALUE
This commit is contained in:
@@ -305,12 +305,7 @@ void spider_free_conn_from_trx(
|
||||
if (another)
|
||||
{
|
||||
ha_spider *next_spider;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&trx->trx_another_conn_hash,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&trx->trx_another_conn_hash, (uchar*) conn);
|
||||
#endif
|
||||
spider = (ha_spider*) conn->another_ha_first;
|
||||
while (spider)
|
||||
{
|
||||
@@ -325,12 +320,7 @@ void spider_free_conn_from_trx(
|
||||
conn->another_ha_first = NULL;
|
||||
conn->another_ha_last = NULL;
|
||||
} else {
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&trx->trx_conn_hash,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&trx->trx_conn_hash, (uchar*) conn);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -350,12 +340,7 @@ void spider_free_conn_from_trx(
|
||||
} else {
|
||||
pthread_mutex_lock(&spider_conn_mutex);
|
||||
uint old_elements = spider_open_connections.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_open_connections,
|
||||
conn->conn_key_hash_value, (uchar*) conn))
|
||||
#else
|
||||
if (my_hash_insert(&spider_open_connections, (uchar*) conn))
|
||||
#endif
|
||||
{
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
spider_free_conn(conn);
|
||||
@@ -763,12 +748,7 @@ SPIDER_CONN *spider_get_conn(
|
||||
}
|
||||
}
|
||||
} else {
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_connections,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||
#endif
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
DBUG_PRINT("info",("spider get global conn"));
|
||||
if (spider)
|
||||
@@ -798,13 +778,7 @@ SPIDER_CONN *spider_get_conn(
|
||||
if (another)
|
||||
{
|
||||
uint old_elements = trx->trx_another_conn_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&trx->trx_another_conn_hash,
|
||||
share->conn_keys_hash_value[link_idx],
|
||||
(uchar*) conn))
|
||||
#else
|
||||
if (my_hash_insert(&trx->trx_another_conn_hash, (uchar*) conn))
|
||||
#endif
|
||||
{
|
||||
spider_free_conn(conn);
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
@@ -819,13 +793,7 @@ SPIDER_CONN *spider_get_conn(
|
||||
}
|
||||
} else {
|
||||
uint old_elements = trx->trx_conn_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&trx->trx_conn_hash,
|
||||
share->conn_keys_hash_value[link_idx],
|
||||
(uchar*) conn))
|
||||
#else
|
||||
if (my_hash_insert(&trx->trx_conn_hash, (uchar*) conn))
|
||||
#endif
|
||||
{
|
||||
spider_free_conn(conn);
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
@@ -1141,12 +1109,7 @@ int spider_conn_queue_and_merge_loop_check(
|
||||
*tmp_name = '-';
|
||||
++tmp_name;
|
||||
memcpy(tmp_name, lcptr->from_value.str, lcptr->from_value.length + 1);
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (unlikely(my_hash_insert_with_hash_value(&conn->loop_check_queue,
|
||||
lcptr->hash_value_to, (uchar *) lcptr)))
|
||||
#else
|
||||
if (unlikely(my_hash_insert(&conn->loop_check_queue, (uchar *) lcptr)))
|
||||
#endif
|
||||
{
|
||||
goto error_hash_insert_queue;
|
||||
}
|
||||
@@ -1198,33 +1161,16 @@ int spider_conn_queue_and_merge_loop_check(
|
||||
memcpy(merged_value, lcptr->from_value.str, lcptr->from_value.length + 1);
|
||||
|
||||
DBUG_PRINT("info", ("spider free lcqptr"));
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&conn->loop_checked,
|
||||
lcqptr->hash_value_full, (uchar *) lcqptr);
|
||||
my_hash_delete_with_hash_value(&conn->loop_check_queue,
|
||||
lcqptr->hash_value_to, (uchar *) lcqptr);
|
||||
#else
|
||||
my_hash_delete(&conn->loop_checked, (uchar*) lcqptr);
|
||||
my_hash_delete(&conn->loop_check_queue, (uchar*) lcqptr);
|
||||
#endif
|
||||
spider_free(spider_current_trx, lcqptr, MYF(0));
|
||||
|
||||
lcptr = lcrptr;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (unlikely(my_hash_insert_with_hash_value(&conn->loop_checked,
|
||||
lcptr->hash_value_full, (uchar *) lcptr)))
|
||||
#else
|
||||
if (unlikely(my_hash_insert(&conn->loop_checked, (uchar *) lcptr)))
|
||||
#endif
|
||||
{
|
||||
goto error_hash_insert;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (unlikely(my_hash_insert_with_hash_value(&conn->loop_check_queue,
|
||||
lcptr->hash_value_to, (uchar *) lcptr)))
|
||||
#else
|
||||
if (unlikely(my_hash_insert(&conn->loop_check_queue, (uchar *) lcptr)))
|
||||
#endif
|
||||
{
|
||||
goto error_hash_insert_queue;
|
||||
}
|
||||
@@ -1243,12 +1189,7 @@ int spider_conn_queue_and_merge_loop_check(
|
||||
|
||||
error_alloc_loop_check_replace:
|
||||
error_hash_insert_queue:
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&conn->loop_checked,
|
||||
lcptr->hash_value_full, (uchar *) lcptr);
|
||||
#else
|
||||
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||
#endif
|
||||
error_hash_insert:
|
||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||
pthread_mutex_unlock(&conn->loop_check_mutex);
|
||||
@@ -1269,12 +1210,7 @@ int spider_conn_reset_queue_loop_check(
|
||||
if (!lcptr->flag)
|
||||
{
|
||||
DBUG_PRINT("info", ("spider free lcptr"));
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&conn->loop_checked,
|
||||
lcptr->hash_value_full, (uchar *) lcptr);
|
||||
#else
|
||||
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||
#endif
|
||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||
}
|
||||
++l;
|
||||
@@ -1426,12 +1362,7 @@ int spider_conn_queue_loop_check(
|
||||
if (unlikely(lcptr))
|
||||
{
|
||||
DBUG_PRINT("info", ("spider free lcptr"));
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&conn->loop_checked,
|
||||
lcptr->hash_value_full, (uchar *) lcptr);
|
||||
#else
|
||||
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||
#endif
|
||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||
}
|
||||
DBUG_PRINT("info", ("spider alloc_lcptr"));
|
||||
@@ -1469,12 +1400,7 @@ int spider_conn_queue_loop_check(
|
||||
lcptr->hash_value_to = my_calc_hash(&conn->loop_checked,
|
||||
(uchar *) to_str.str, to_str.length);
|
||||
lcptr->hash_value_full = hash_value;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (unlikely(my_hash_insert_with_hash_value(&conn->loop_checked,
|
||||
lcptr->hash_value_full, (uchar *) lcptr)))
|
||||
#else
|
||||
if (unlikely(my_hash_insert(&conn->loop_checked, (uchar *) lcptr)))
|
||||
#endif
|
||||
{
|
||||
my_afree(loop_check_buf);
|
||||
goto error_hash_insert;
|
||||
@@ -4182,12 +4108,7 @@ SPIDER_CONN* spider_get_conn_from_idle_connection(
|
||||
share->conn_keys_lengths[link_idx])))
|
||||
{
|
||||
/* get conn from spider_open_connections, then delete conn in spider_open_connections */
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_connections,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||
#endif
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
DBUG_PRINT("info",("spider get global conn"));
|
||||
if (spider)
|
||||
|
@@ -3401,12 +3401,7 @@ int spider_db_mbase::set_loop_check(
|
||||
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
|
||||
pthread_mutex_unlock(&conn->mta_conn_mutex);
|
||||
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&conn->loop_check_queue,
|
||||
lcptr->hash_value, (uchar *) lcptr);
|
||||
#else
|
||||
my_hash_delete(&conn->loop_check_queue, (uchar*) lcptr);
|
||||
#endif
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
@@ -3804,12 +3799,7 @@ int spider_db_mbase::append_lock_tables(
|
||||
my_hash_reset(&lock_table_hash);
|
||||
DBUG_RETURN(error_num);
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&lock_table_hash,
|
||||
tmp_link_for_hash->db_table_str_hash_value, (uchar*) tmp_link_for_hash);
|
||||
#else
|
||||
my_hash_delete(&lock_table_hash, (uchar*) tmp_link_for_hash);
|
||||
#endif
|
||||
}
|
||||
if ((error_num = spider_db_mbase_utility->append_lock_table_tail(str)))
|
||||
{
|
||||
@@ -13661,15 +13651,8 @@ int spider_mbase_handler::insert_lock_tables_list(
|
||||
DBUG_PRINT("info",("spider this=%p", this));
|
||||
uint old_elements =
|
||||
db_conn->lock_table_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash2->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#else
|
||||
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#endif
|
||||
{
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
}
|
||||
@@ -13716,26 +13699,12 @@ int spider_mbase_handler::append_lock_tables_list(
|
||||
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
||||
spider->wide_handler->lock_type)
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash);
|
||||
#else
|
||||
my_hash_delete(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash);
|
||||
#endif
|
||||
uint old_elements =
|
||||
db_conn->lock_table_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash2->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#else
|
||||
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#endif
|
||||
{
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
}
|
||||
|
@@ -2355,12 +2355,7 @@ int spider_db_oracle::append_lock_tables(
|
||||
my_hash_reset(&lock_table_hash);
|
||||
DBUG_RETURN(error_num);
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&lock_table_hash,
|
||||
tmp_link_for_hash->db_table_str_hash_value, (uchar*) tmp_link_for_hash);
|
||||
#else
|
||||
my_hash_delete(&lock_table_hash, (uchar*) tmp_link_for_hash);
|
||||
#endif
|
||||
|
||||
if ((error_num = spider_db_oracle_utility.append_lock_table_tail(str)))
|
||||
{
|
||||
@@ -10346,15 +10341,8 @@ int spider_oracle_handler::insert_lock_tables_list(
|
||||
DBUG_PRINT("info",("spider this=%p", this));
|
||||
uint old_elements =
|
||||
db_conn->lock_table_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash2->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#else
|
||||
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#endif
|
||||
{
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
}
|
||||
@@ -10398,26 +10386,12 @@ int spider_oracle_handler::append_lock_tables_list(
|
||||
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
||||
spider->wide_handler->lock_type)
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash);
|
||||
#else
|
||||
my_hash_delete(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash);
|
||||
#endif
|
||||
uint old_elements =
|
||||
db_conn->lock_table_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(
|
||||
&db_conn->lock_table_hash,
|
||||
tmp_link_for_hash2->db_table_str_hash_value,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#else
|
||||
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||
(uchar*) tmp_link_for_hash2))
|
||||
#endif
|
||||
{
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
}
|
||||
|
@@ -657,12 +657,7 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
||||
error_num)))
|
||||
goto error;
|
||||
} else {
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_connections,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||
#endif
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
DBUG_PRINT("info",("spider get global conn"));
|
||||
}
|
||||
@@ -676,12 +671,7 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
||||
conn->priority = direct_sql->priority;
|
||||
|
||||
uint old_elements = trx->trx_conn_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&trx->trx_conn_hash,
|
||||
direct_sql->conn_key_hash_value, (uchar*) conn))
|
||||
#else
|
||||
if (my_hash_insert(&trx->trx_conn_hash, (uchar*) conn))
|
||||
#endif
|
||||
{
|
||||
spider_free_conn(conn);
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
|
@@ -131,14 +131,8 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
|
||||
uint old_elements =
|
||||
spider_udf_table_mon_list_hash[mutex_hash].array.max_element;
|
||||
table_mon_list->key_hash_value = hash_value;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(
|
||||
&spider_udf_table_mon_list_hash[mutex_hash],
|
||||
hash_value, (uchar*) table_mon_list))
|
||||
#else
|
||||
if (my_hash_insert(&spider_udf_table_mon_list_hash[mutex_hash],
|
||||
(uchar*) table_mon_list))
|
||||
#endif
|
||||
{
|
||||
spider_ping_table_free_mon_list(table_mon_list);
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
@@ -187,13 +181,8 @@ void spider_release_ping_table_mon_list_loop(
|
||||
SPIDER_TABLE_MON_LIST *table_mon_list
|
||||
) {
|
||||
DBUG_ENTER("spider_release_ping_table_mon_list_loop");
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_udf_table_mon_list_hash[mutex_hash],
|
||||
table_mon_list->key_hash_value, (uchar*) table_mon_list);
|
||||
#else
|
||||
my_hash_delete(&spider_udf_table_mon_list_hash[mutex_hash],
|
||||
(uchar*) table_mon_list);
|
||||
#endif
|
||||
while (TRUE)
|
||||
{
|
||||
if (table_mon_list->use_count)
|
||||
|
@@ -4685,12 +4685,7 @@ SPIDER_SHARE *spider_get_share(
|
||||
}
|
||||
|
||||
uint old_elements = spider_open_tables.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_open_tables, hash_value,
|
||||
(uchar*) share))
|
||||
#else
|
||||
if (my_hash_insert(&spider_open_tables, (uchar*) share))
|
||||
#endif
|
||||
{
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
goto error_hash_insert;
|
||||
@@ -4842,14 +4837,9 @@ SPIDER_SHARE *spider_get_share(
|
||||
spider_free_share(share);
|
||||
goto error_sts_spider_init;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
share->sts_thread = &spider_table_sts_threads[
|
||||
hash_value % spider_param_table_sts_thread_count()];
|
||||
#else
|
||||
share->sts_thread = &spider_table_sts_threads[
|
||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||
spider_param_table_sts_thread_count()];
|
||||
#endif
|
||||
share->sts_spider_init = TRUE;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
@@ -4870,14 +4860,9 @@ SPIDER_SHARE *spider_get_share(
|
||||
spider_free_share(share);
|
||||
goto error_crd_spider_init;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
share->crd_thread = &spider_table_crd_threads[
|
||||
hash_value % spider_param_table_crd_thread_count()];
|
||||
#else
|
||||
share->crd_thread = &spider_table_crd_threads[
|
||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||
spider_param_table_crd_thread_count()];
|
||||
#endif
|
||||
share->crd_spider_init = TRUE;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
@@ -5330,14 +5315,9 @@ SPIDER_SHARE *spider_get_share(
|
||||
spider_free_share(share);
|
||||
goto error_sts_spider_init;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
share->sts_thread = &spider_table_sts_threads[
|
||||
hash_value % spider_param_table_sts_thread_count()];
|
||||
#else
|
||||
share->sts_thread = &spider_table_sts_threads[
|
||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||
spider_param_table_sts_thread_count()];
|
||||
#endif
|
||||
share->sts_spider_init = TRUE;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
@@ -5355,14 +5335,9 @@ SPIDER_SHARE *spider_get_share(
|
||||
spider_free_share(share);
|
||||
goto error_crd_spider_init;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
share->crd_thread = &spider_table_crd_threads[
|
||||
hash_value % spider_param_table_crd_thread_count()];
|
||||
#else
|
||||
share->crd_thread = &spider_table_crd_threads[
|
||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||
spider_param_table_crd_thread_count()];
|
||||
#endif
|
||||
share->crd_spider_init = TRUE;
|
||||
}
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
@@ -5761,12 +5736,7 @@ int spider_free_share(
|
||||
);
|
||||
}
|
||||
spider_free_share_alloc(share);
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_tables,
|
||||
share->table_name_hash_value, (uchar*) share);
|
||||
#else
|
||||
my_hash_delete(&spider_open_tables, (uchar*) share);
|
||||
#endif
|
||||
pthread_mutex_destroy(&share->crd_mutex);
|
||||
pthread_mutex_destroy(&share->sts_mutex);
|
||||
pthread_mutex_destroy(&share->mutex);
|
||||
@@ -5853,13 +5823,8 @@ SPIDER_LGTM_TBLHND_SHARE *spider_get_lgtm_tblhnd_share(
|
||||
}
|
||||
|
||||
uint old_elements = spider_lgtm_tblhnd_share_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_lgtm_tblhnd_share_hash,
|
||||
hash_value, (uchar*) lgtm_tblhnd_share))
|
||||
#else
|
||||
if (my_hash_insert(&spider_lgtm_tblhnd_share_hash,
|
||||
(uchar*) lgtm_tblhnd_share))
|
||||
#endif
|
||||
{
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
goto error_hash_insert;
|
||||
@@ -5895,12 +5860,7 @@ void spider_free_lgtm_tblhnd_share_alloc(
|
||||
DBUG_ENTER("spider_free_lgtm_tblhnd_share");
|
||||
if (!locked)
|
||||
pthread_mutex_lock(&spider_lgtm_tblhnd_share_mutex);
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_lgtm_tblhnd_share_hash,
|
||||
lgtm_tblhnd_share->table_path_hash_value, (uchar*) lgtm_tblhnd_share);
|
||||
#else
|
||||
my_hash_delete(&spider_lgtm_tblhnd_share_hash, (uchar*) lgtm_tblhnd_share);
|
||||
#endif
|
||||
pthread_mutex_destroy(&lgtm_tblhnd_share->auto_increment_mutex);
|
||||
spider_free(spider_current_trx, lgtm_tblhnd_share, MYF(0));
|
||||
if (!locked)
|
||||
@@ -5965,13 +5925,7 @@ SPIDER_WIDE_SHARE *spider_get_wide_share(
|
||||
thr_lock_init(&wide_share->lock);
|
||||
|
||||
uint old_elements = spider_open_wide_share.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_open_wide_share,
|
||||
share->table_path_hash_value,
|
||||
(uchar*) wide_share))
|
||||
#else
|
||||
if (my_hash_insert(&spider_open_wide_share, (uchar*) wide_share))
|
||||
#endif
|
||||
{
|
||||
*error_num = HA_ERR_OUT_OF_MEM;
|
||||
goto error_hash_insert;
|
||||
@@ -6009,12 +5963,7 @@ int spider_free_wide_share(
|
||||
if (!--wide_share->use_count)
|
||||
{
|
||||
thr_lock_delete(&wide_share->lock);
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_wide_share,
|
||||
wide_share->table_path_hash_value, (uchar*) wide_share);
|
||||
#else
|
||||
my_hash_delete(&spider_open_wide_share, (uchar*) wide_share);
|
||||
#endif
|
||||
pthread_mutex_destroy(&wide_share->crd_mutex);
|
||||
pthread_mutex_destroy(&wide_share->sts_mutex);
|
||||
spider_free(spider_current_trx, wide_share, MYF(0));
|
||||
@@ -6515,14 +6464,8 @@ int spider_db_done(
|
||||
while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element(
|
||||
&spider_udf_table_mon_list_hash[roop_count], 0)))
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(
|
||||
&spider_udf_table_mon_list_hash[roop_count],
|
||||
table_mon_list->key_hash_value, (uchar*) table_mon_list);
|
||||
#else
|
||||
my_hash_delete(&spider_udf_table_mon_list_hash[roop_count],
|
||||
(uchar*) table_mon_list);
|
||||
#endif
|
||||
spider_ping_table_free_mon_list(table_mon_list);
|
||||
}
|
||||
spider_free_mem_calc(spider_current_trx,
|
||||
@@ -6558,12 +6501,7 @@ int spider_db_done(
|
||||
pthread_mutex_lock(&spider_conn_mutex);
|
||||
while ((conn = (SPIDER_CONN*) my_hash_element(&spider_open_connections, 0)))
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_open_connections,
|
||||
conn->conn_key_hash_value, (uchar*) conn);
|
||||
#else
|
||||
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||
#endif
|
||||
spider_free_conn(conn);
|
||||
}
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
@@ -6606,14 +6544,8 @@ int spider_db_done(
|
||||
while ((spider_init_error_table = (SPIDER_INIT_ERROR_TABLE*)
|
||||
my_hash_element(&spider_init_error_tables, 0)))
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_init_error_tables,
|
||||
spider_init_error_table->table_name_hash_value,
|
||||
(uchar*) spider_init_error_table);
|
||||
#else
|
||||
my_hash_delete(&spider_init_error_tables,
|
||||
(uchar*) spider_init_error_table);
|
||||
#endif
|
||||
spider_free(NULL, spider_init_error_table, MYF(0));
|
||||
}
|
||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||
@@ -7637,13 +7569,8 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
|
||||
spider_init_error_table->table_name_hash_value =
|
||||
share->table_name_hash_value;
|
||||
uint old_elements = spider_init_error_tables.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_init_error_tables,
|
||||
share->table_name_hash_value, (uchar*) spider_init_error_table))
|
||||
#else
|
||||
if (my_hash_insert(&spider_init_error_tables,
|
||||
(uchar*) spider_init_error_table))
|
||||
#endif
|
||||
{
|
||||
spider_free(trx, spider_init_error_table, MYF(0));
|
||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||
@@ -7674,14 +7601,8 @@ void spider_delete_init_error_table(
|
||||
my_hash_search_using_hash_value(&spider_init_error_tables, hash_value,
|
||||
(uchar*) name, length)))
|
||||
{
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_init_error_tables,
|
||||
spider_init_error_table->table_name_hash_value,
|
||||
(uchar*) spider_init_error_table);
|
||||
#else
|
||||
my_hash_delete(&spider_init_error_tables,
|
||||
(uchar*) spider_init_error_table);
|
||||
#endif
|
||||
spider_free(spider_current_trx, spider_init_error_table, MYF(0));
|
||||
}
|
||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||
|
@@ -367,12 +367,7 @@ void spider_free_trx_alter_table_alloc(
|
||||
SPIDER_ALTER_TABLE *alter_table
|
||||
) {
|
||||
DBUG_ENTER("spider_free_trx_alter_table_alloc");
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&trx->trx_alter_table_hash,
|
||||
alter_table->table_name_hash_value, (uchar*) alter_table);
|
||||
#else
|
||||
my_hash_delete(&trx->trx_alter_table_hash, (uchar*) alter_table);
|
||||
#endif
|
||||
if (alter_table->tmp_char)
|
||||
spider_free(trx, alter_table->tmp_char, MYF(0));
|
||||
spider_free(trx, alter_table, MYF(0));
|
||||
@@ -853,12 +848,7 @@ int spider_create_trx_alter_table(
|
||||
share_alter->tmp_link_statuses_length;
|
||||
|
||||
old_elements = trx->trx_alter_table_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&trx->trx_alter_table_hash,
|
||||
alter_table->table_name_hash_value, (uchar*) alter_table))
|
||||
#else
|
||||
if (my_hash_insert(&trx->trx_alter_table_hash, (uchar*) alter_table))
|
||||
#endif
|
||||
{
|
||||
error_num = HA_ERR_OUT_OF_MEM;
|
||||
goto error;
|
||||
@@ -1348,12 +1338,7 @@ SPIDER_TRX *spider_get_trx(
|
||||
{
|
||||
pthread_mutex_lock(&spider_allocated_thds_mutex);
|
||||
uint old_elements = spider_allocated_thds.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&spider_allocated_thds,
|
||||
trx->thd_hash_value, (uchar*) thd))
|
||||
#else
|
||||
if (my_hash_insert(&spider_allocated_thds, (uchar*) thd))
|
||||
#endif
|
||||
{
|
||||
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
||||
goto error_allocated_thds_insert;
|
||||
@@ -1459,12 +1444,7 @@ int spider_free_trx(
|
||||
{
|
||||
if (need_lock)
|
||||
pthread_mutex_lock(&spider_allocated_thds_mutex);
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&spider_allocated_thds,
|
||||
trx->thd_hash_value, (uchar*) trx->thd);
|
||||
#else
|
||||
my_hash_delete(&spider_allocated_thds, (uchar*) trx->thd);
|
||||
#endif
|
||||
if (need_lock)
|
||||
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
||||
}
|
||||
@@ -1652,17 +1632,7 @@ static int spider_xa_lock(
|
||||
error_num = ER_SPIDER_XA_LOCKED_NUM;
|
||||
goto error;
|
||||
}
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
#ifdef XID_CACHE_IS_SPLITTED
|
||||
if (my_hash_insert_with_hash_value(&spd_db_att_xid_cache[idx], hash_value,
|
||||
(uchar*)xid_state))
|
||||
#else
|
||||
if (my_hash_insert_with_hash_value(spd_db_att_xid_cache, hash_value,
|
||||
(uchar*)xid_state))
|
||||
#endif
|
||||
#else
|
||||
if (my_hash_insert(spd_db_att_xid_cache, (uchar*)xid_state))
|
||||
#endif
|
||||
{
|
||||
error_num = HA_ERR_OUT_OF_MEM;
|
||||
goto error;
|
||||
@@ -1697,13 +1667,6 @@ static int spider_xa_unlock(
|
||||
DBUG_ENTER("spider_xa_unlock");
|
||||
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
||||
#else
|
||||
#if defined(SPIDER_HAS_HASH_VALUE_TYPE) && defined(HASH_UPDATE_WITH_HASH_VALUE)
|
||||
my_hash_value_type hash_value = my_calc_hash(spd_db_att_xid_cache,
|
||||
(uchar*) xid_state->xid.key(), xid_state->xid.key_length());
|
||||
#ifdef XID_CACHE_IS_SPLITTED
|
||||
uint idx = hash_value % *spd_db_att_xid_cache_split_num;
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
old_proc_info = thd_proc_info(thd, "Unlocking xid by Spider");
|
||||
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
||||
@@ -1714,17 +1677,7 @@ static int spider_xa_unlock(
|
||||
#else
|
||||
pthread_mutex_lock(spd_db_att_LOCK_xid_cache);
|
||||
#endif
|
||||
#if defined(SPIDER_HAS_HASH_VALUE_TYPE) && defined(HASH_UPDATE_WITH_HASH_VALUE)
|
||||
#ifdef XID_CACHE_IS_SPLITTED
|
||||
my_hash_delete_with_hash_value(&spd_db_att_xid_cache[idx],
|
||||
hash_value, (uchar *)xid_state);
|
||||
#else
|
||||
my_hash_delete_with_hash_value(spd_db_att_xid_cache,
|
||||
hash_value, (uchar *)xid_state);
|
||||
#endif
|
||||
#else
|
||||
my_hash_delete(spd_db_att_xid_cache, (uchar *)xid_state);
|
||||
#endif
|
||||
#ifdef XID_CACHE_IS_SPLITTED
|
||||
pthread_mutex_unlock(&spd_db_att_LOCK_xid_cache[idx]);
|
||||
#else
|
||||
@@ -3854,12 +3807,7 @@ int spider_create_trx_ha(
|
||||
) {
|
||||
DBUG_PRINT("info",("spider need recreate"));
|
||||
need_create = TRUE;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
my_hash_delete_with_hash_value(&trx->trx_ha_hash,
|
||||
share->table_name_hash_value, (uchar*) trx_ha);
|
||||
#else
|
||||
my_hash_delete(&trx->trx_ha_hash, (uchar*) trx_ha);
|
||||
#endif
|
||||
spider_free(trx, trx_ha, MYF(0));
|
||||
} else {
|
||||
DBUG_PRINT("info",("spider use this"));
|
||||
@@ -3890,12 +3838,7 @@ int spider_create_trx_ha(
|
||||
trx_ha->conn_can_fo = conn_can_fo;
|
||||
trx_ha->wait_for_reusing = FALSE;
|
||||
uint old_elements = trx->trx_ha_hash.array.max_element;
|
||||
#ifdef HASH_UPDATE_WITH_HASH_VALUE
|
||||
if (my_hash_insert_with_hash_value(&trx->trx_ha_hash,
|
||||
share->table_name_hash_value, (uchar*) trx_ha))
|
||||
#else
|
||||
if (my_hash_insert(&trx->trx_ha_hash, (uchar*) trx_ha))
|
||||
#endif
|
||||
{
|
||||
spider_free(trx, trx_ha, MYF(0));
|
||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||
|
Reference in New Issue
Block a user