mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-27648 remove #define HASH_UPDATE_WITH_HASH_VALUE
The functions called in blocks protected by this macro remain
undefined as of 11.5 c96b23f994
This commit is contained in:
@@ -309,12 +309,7 @@ void spider_free_conn_from_trx(
|
|||||||
if (another)
|
if (another)
|
||||||
{
|
{
|
||||||
ha_spider *next_spider;
|
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);
|
my_hash_delete(&trx->trx_another_conn_hash, (uchar*) conn);
|
||||||
#endif
|
|
||||||
spider = (ha_spider*) conn->another_ha_first;
|
spider = (ha_spider*) conn->another_ha_first;
|
||||||
while (spider)
|
while (spider)
|
||||||
{
|
{
|
||||||
@@ -329,12 +324,7 @@ void spider_free_conn_from_trx(
|
|||||||
conn->another_ha_first = NULL;
|
conn->another_ha_first = NULL;
|
||||||
conn->another_ha_last = NULL;
|
conn->another_ha_last = NULL;
|
||||||
} else {
|
} 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);
|
my_hash_delete(&trx->trx_conn_hash, (uchar*) conn);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (
|
if (
|
||||||
@@ -354,12 +344,7 @@ void spider_free_conn_from_trx(
|
|||||||
} else {
|
} else {
|
||||||
pthread_mutex_lock(&spider_conn_mutex);
|
pthread_mutex_lock(&spider_conn_mutex);
|
||||||
uint old_elements = spider_open_connections.array.max_element;
|
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))
|
if (my_hash_insert(&spider_open_connections, (uchar*) conn))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&spider_conn_mutex);
|
pthread_mutex_unlock(&spider_conn_mutex);
|
||||||
spider_free_conn(conn);
|
spider_free_conn(conn);
|
||||||
@@ -721,12 +706,7 @@ SPIDER_CONN *spider_get_conn(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} 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);
|
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||||
#endif
|
|
||||||
pthread_mutex_unlock(&spider_conn_mutex);
|
pthread_mutex_unlock(&spider_conn_mutex);
|
||||||
DBUG_PRINT("info",("spider get global conn"));
|
DBUG_PRINT("info",("spider get global conn"));
|
||||||
if (spider)
|
if (spider)
|
||||||
@@ -756,13 +736,7 @@ SPIDER_CONN *spider_get_conn(
|
|||||||
if (another)
|
if (another)
|
||||||
{
|
{
|
||||||
uint old_elements = trx->trx_another_conn_hash.array.max_element;
|
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))
|
if (my_hash_insert(&trx->trx_another_conn_hash, (uchar*) conn))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_free_conn(conn);
|
spider_free_conn(conn);
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
@@ -777,13 +751,7 @@ SPIDER_CONN *spider_get_conn(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint old_elements = trx->trx_conn_hash.array.max_element;
|
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))
|
if (my_hash_insert(&trx->trx_conn_hash, (uchar*) conn))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_free_conn(conn);
|
spider_free_conn(conn);
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
@@ -1133,12 +1101,7 @@ int spider_conn_queue_and_merge_loop_check(
|
|||||||
*tmp_name = '-';
|
*tmp_name = '-';
|
||||||
++tmp_name;
|
++tmp_name;
|
||||||
memcpy(tmp_name, lcptr->from_value.str, lcptr->from_value.length + 1);
|
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)))
|
if (unlikely(my_hash_insert(&conn->loop_check_queue, (uchar *) lcptr)))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
goto error_hash_insert_queue;
|
goto error_hash_insert_queue;
|
||||||
}
|
}
|
||||||
@@ -1196,33 +1159,16 @@ int spider_conn_queue_and_merge_loop_check(
|
|||||||
memcpy(merged_value, lcptr->from_value.str, lcptr->from_value.length + 1);
|
memcpy(merged_value, lcptr->from_value.str, lcptr->from_value.length + 1);
|
||||||
|
|
||||||
DBUG_PRINT("info", ("spider free lcqptr"));
|
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_checked, (uchar*) lcqptr);
|
||||||
my_hash_delete(&conn->loop_check_queue, (uchar*) lcqptr);
|
my_hash_delete(&conn->loop_check_queue, (uchar*) lcqptr);
|
||||||
#endif
|
|
||||||
spider_free(spider_current_trx, lcqptr, MYF(0));
|
spider_free(spider_current_trx, lcqptr, MYF(0));
|
||||||
|
|
||||||
lcptr = lcrptr;
|
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)))
|
if (unlikely(my_hash_insert(&conn->loop_checked, (uchar *) lcptr)))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
goto error_hash_insert;
|
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)))
|
if (unlikely(my_hash_insert(&conn->loop_check_queue, (uchar *) lcptr)))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
goto error_hash_insert_queue;
|
goto error_hash_insert_queue;
|
||||||
}
|
}
|
||||||
@@ -1232,12 +1178,7 @@ int spider_conn_queue_and_merge_loop_check(
|
|||||||
|
|
||||||
error_alloc_loop_check_replace:
|
error_alloc_loop_check_replace:
|
||||||
error_hash_insert_queue:
|
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);
|
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||||
#endif
|
|
||||||
error_hash_insert:
|
error_hash_insert:
|
||||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||||
pthread_mutex_unlock(&conn->loop_check_mutex);
|
pthread_mutex_unlock(&conn->loop_check_mutex);
|
||||||
@@ -1257,12 +1198,7 @@ int spider_conn_reset_queue_loop_check(
|
|||||||
if (!lcptr->flag)
|
if (!lcptr->flag)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("spider free 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);
|
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||||
#endif
|
|
||||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||||
}
|
}
|
||||||
++l;
|
++l;
|
||||||
@@ -1424,12 +1360,7 @@ int spider_conn_queue_loop_check(
|
|||||||
if (unlikely(lcptr))
|
if (unlikely(lcptr))
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info", ("spider free 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);
|
my_hash_delete(&conn->loop_checked, (uchar*) lcptr);
|
||||||
#endif
|
|
||||||
spider_free(spider_current_trx, lcptr, MYF(0));
|
spider_free(spider_current_trx, lcptr, MYF(0));
|
||||||
}
|
}
|
||||||
DBUG_PRINT("info", ("spider alloc_lcptr"));
|
DBUG_PRINT("info", ("spider alloc_lcptr"));
|
||||||
@@ -1466,16 +1397,7 @@ int spider_conn_queue_loop_check(
|
|||||||
lcptr->merged_value.str = merged_value;
|
lcptr->merged_value.str = merged_value;
|
||||||
lcptr->hash_value_to = my_calc_hash(&conn->loop_check_queue,
|
lcptr->hash_value_to = my_calc_hash(&conn->loop_check_queue,
|
||||||
(uchar *) to_str.str, to_str.length);
|
(uchar *) to_str.str, to_str.length);
|
||||||
/*
|
|
||||||
Mark as checked. It will be added to loop_check_queue in
|
|
||||||
spider_conn_queue_and_merge_loop_check() below for checking
|
|
||||||
*/
|
|
||||||
#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)))
|
if (unlikely(my_hash_insert(&conn->loop_checked, (uchar *) lcptr)))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
my_afree(loop_check_buf);
|
my_afree(loop_check_buf);
|
||||||
goto error_hash_insert;
|
goto error_hash_insert;
|
||||||
@@ -3154,32 +3076,6 @@ void *spider_bg_sts_action(
|
|||||||
trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
|
trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
|
||||||
&error_num);
|
&error_num);
|
||||||
conns[spider.search_link_idx]->error_mode = 0;
|
conns[spider.search_link_idx]->error_mode = 0;
|
||||||
/*
|
|
||||||
if (
|
|
||||||
error_num &&
|
|
||||||
share->monitoring_kind[spider.search_link_idx] &&
|
|
||||||
need_mons[spider.search_link_idx]
|
|
||||||
) {
|
|
||||||
lex_start(thd);
|
|
||||||
error_num = spider_ping_table_mon_from_table(
|
|
||||||
trx,
|
|
||||||
thd,
|
|
||||||
share,
|
|
||||||
spider.search_link_idx,
|
|
||||||
(uint32) share->monitoring_sid[spider.search_link_idx],
|
|
||||||
share->table_name,
|
|
||||||
share->table_name_length,
|
|
||||||
spider.conn_link_idx[spider.search_link_idx],
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
share->monitoring_kind[spider.search_link_idx],
|
|
||||||
share->monitoring_limit[spider.search_link_idx],
|
|
||||||
share->monitoring_flag[spider.search_link_idx],
|
|
||||||
TRUE
|
|
||||||
);
|
|
||||||
lex_end(thd->lex);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
spider.search_link_idx = -1;
|
spider.search_link_idx = -1;
|
||||||
}
|
}
|
||||||
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
|
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
|
||||||
@@ -3197,31 +3093,6 @@ void *spider_bg_sts_action(
|
|||||||
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
|
2, HA_STATUS_CONST | HA_STATUS_VARIABLE))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (
|
|
||||||
share->monitoring_kind[spider.search_link_idx] &&
|
|
||||||
need_mons[spider.search_link_idx]
|
|
||||||
) {
|
|
||||||
lex_start(thd);
|
|
||||||
error_num = spider_ping_table_mon_from_table(
|
|
||||||
trx,
|
|
||||||
thd,
|
|
||||||
share,
|
|
||||||
spider.search_link_idx,
|
|
||||||
(uint32) share->monitoring_sid[spider.search_link_idx],
|
|
||||||
share->table_name,
|
|
||||||
share->table_name_length,
|
|
||||||
spider.conn_link_idx[spider.search_link_idx],
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
share->monitoring_kind[spider.search_link_idx],
|
|
||||||
share->monitoring_limit[spider.search_link_idx],
|
|
||||||
share->monitoring_flag[spider.search_link_idx],
|
|
||||||
TRUE
|
|
||||||
);
|
|
||||||
lex_end(thd->lex);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
spider.search_link_idx = -1;
|
spider.search_link_idx = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3464,12 +3335,6 @@ void *spider_bg_crd_action(
|
|||||||
if (spider.search_link_idx < 0)
|
if (spider.search_link_idx < 0)
|
||||||
{
|
{
|
||||||
spider_trx_set_link_idx_for_all(&spider);
|
spider_trx_set_link_idx_for_all(&spider);
|
||||||
/*
|
|
||||||
spider.search_link_idx = spider_conn_next_link_idx(
|
|
||||||
thd, share->link_statuses, share->access_balances,
|
|
||||||
spider.conn_link_idx, spider.search_link_idx, share->link_count,
|
|
||||||
SPIDER_LINK_STATUS_OK);
|
|
||||||
*/
|
|
||||||
spider.search_link_idx = spider_conn_first_link_idx(thd,
|
spider.search_link_idx = spider_conn_first_link_idx(thd,
|
||||||
share->link_statuses, share->access_balances, spider.conn_link_idx,
|
share->link_statuses, share->access_balances, spider.conn_link_idx,
|
||||||
share->link_count, SPIDER_LINK_STATUS_OK);
|
share->link_count, SPIDER_LINK_STATUS_OK);
|
||||||
@@ -3486,32 +3351,6 @@ void *spider_bg_crd_action(
|
|||||||
trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
|
trx, &spider, FALSE, FALSE, SPIDER_CONN_KIND_MYSQL,
|
||||||
&error_num);
|
&error_num);
|
||||||
conns[spider.search_link_idx]->error_mode = 0;
|
conns[spider.search_link_idx]->error_mode = 0;
|
||||||
/*
|
|
||||||
if (
|
|
||||||
error_num &&
|
|
||||||
share->monitoring_kind[spider.search_link_idx] &&
|
|
||||||
need_mons[spider.search_link_idx]
|
|
||||||
) {
|
|
||||||
lex_start(thd);
|
|
||||||
error_num = spider_ping_table_mon_from_table(
|
|
||||||
trx,
|
|
||||||
thd,
|
|
||||||
share,
|
|
||||||
spider.search_link_idx,
|
|
||||||
(uint32) share->monitoring_sid[spider.search_link_idx],
|
|
||||||
share->table_name,
|
|
||||||
share->table_name_length,
|
|
||||||
spider.conn_link_idx[spider.search_link_idx],
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
share->monitoring_kind[spider.search_link_idx],
|
|
||||||
share->monitoring_limit[spider.search_link_idx],
|
|
||||||
share->monitoring_flag[spider.search_link_idx],
|
|
||||||
TRUE
|
|
||||||
);
|
|
||||||
lex_end(thd->lex);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
spider.search_link_idx = -1;
|
spider.search_link_idx = -1;
|
||||||
}
|
}
|
||||||
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
|
if (spider.search_link_idx != -1 && conns[spider.search_link_idx])
|
||||||
@@ -3529,31 +3368,6 @@ void *spider_bg_crd_action(
|
|||||||
2))
|
2))
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
/*
|
|
||||||
if (
|
|
||||||
share->monitoring_kind[spider.search_link_idx] &&
|
|
||||||
need_mons[spider.search_link_idx]
|
|
||||||
) {
|
|
||||||
lex_start(thd);
|
|
||||||
error_num = spider_ping_table_mon_from_table(
|
|
||||||
trx,
|
|
||||||
thd,
|
|
||||||
share,
|
|
||||||
spider.search_link_idx,
|
|
||||||
(uint32) share->monitoring_sid[spider.search_link_idx],
|
|
||||||
share->table_name,
|
|
||||||
share->table_name_length,
|
|
||||||
spider.conn_link_idx[spider.search_link_idx],
|
|
||||||
NULL,
|
|
||||||
0,
|
|
||||||
share->monitoring_kind[spider.search_link_idx],
|
|
||||||
share->monitoring_limit[spider.search_link_idx],
|
|
||||||
share->monitoring_flag[spider.search_link_idx],
|
|
||||||
TRUE
|
|
||||||
);
|
|
||||||
lex_end(thd->lex);
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
spider.search_link_idx = -1;
|
spider.search_link_idx = -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -3858,17 +3672,11 @@ void *spider_bg_mon_action(
|
|||||||
share->monitoring_bg_interval[link_idx] * 1000);
|
share->monitoring_bg_interval[link_idx] * 1000);
|
||||||
pthread_cond_timedwait(&share->bg_mon_sleep_conds[link_idx],
|
pthread_cond_timedwait(&share->bg_mon_sleep_conds[link_idx],
|
||||||
&share->bg_mon_mutexes[link_idx], &abstime);
|
&share->bg_mon_mutexes[link_idx], &abstime);
|
||||||
/*
|
|
||||||
my_sleep((ulong) share->monitoring_bg_interval[link_idx]);
|
|
||||||
*/
|
|
||||||
}
|
}
|
||||||
DBUG_PRINT("info",("spider bg mon roop start"));
|
DBUG_PRINT("info",("spider bg mon roop start"));
|
||||||
if (share->bg_mon_kill)
|
if (share->bg_mon_kill)
|
||||||
{
|
{
|
||||||
DBUG_PRINT("info",("spider bg mon kill start"));
|
DBUG_PRINT("info",("spider bg mon kill start"));
|
||||||
/*
|
|
||||||
pthread_mutex_lock(&share->bg_mon_mutexes[link_idx]);
|
|
||||||
*/
|
|
||||||
pthread_cond_signal(&share->bg_mon_conds[link_idx]);
|
pthread_cond_signal(&share->bg_mon_conds[link_idx]);
|
||||||
pthread_mutex_unlock(&share->bg_mon_mutexes[link_idx]);
|
pthread_mutex_unlock(&share->bg_mon_mutexes[link_idx]);
|
||||||
spider_free_trx(trx, TRUE);
|
spider_free_trx(trx, TRUE);
|
||||||
@@ -4241,12 +4049,7 @@ SPIDER_CONN* spider_get_conn_from_idle_connection(
|
|||||||
share->conn_keys_lengths[link_idx])))
|
share->conn_keys_lengths[link_idx])))
|
||||||
{
|
{
|
||||||
/* get conn from spider_open_connections, then delete conn in spider_open_connections */
|
/* 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);
|
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||||
#endif
|
|
||||||
pthread_mutex_unlock(&spider_conn_mutex);
|
pthread_mutex_unlock(&spider_conn_mutex);
|
||||||
DBUG_PRINT("info",("spider get global conn"));
|
DBUG_PRINT("info",("spider get global conn"));
|
||||||
if (spider)
|
if (spider)
|
||||||
|
@@ -26,9 +26,6 @@
|
|||||||
#define SPIDER_DB_WRAPPER_MARIADB "mariadb"
|
#define SPIDER_DB_WRAPPER_MARIADB "mariadb"
|
||||||
|
|
||||||
#define PLUGIN_VAR_CAN_MEMALLOC
|
#define PLUGIN_VAR_CAN_MEMALLOC
|
||||||
/*
|
|
||||||
#define HASH_UPDATE_WITH_HASH_VALUE
|
|
||||||
*/
|
|
||||||
|
|
||||||
#define SPIDER_HAS_DISCOVER_TABLE_STRUCTURE
|
#define SPIDER_HAS_DISCOVER_TABLE_STRUCTURE
|
||||||
#define SPIDER_HAS_APPEND_FOR_SINGLE_QUOTE
|
#define SPIDER_HAS_APPEND_FOR_SINGLE_QUOTE
|
||||||
|
@@ -3630,12 +3630,7 @@ int spider_db_mbase::append_lock_tables(
|
|||||||
my_hash_reset(&lock_table_hash);
|
my_hash_reset(&lock_table_hash);
|
||||||
DBUG_RETURN(error_num);
|
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);
|
my_hash_delete(&lock_table_hash, (uchar*) tmp_link_for_hash);
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
if ((error_num = spider_db_mbase_utility->append_lock_table_tail(str)))
|
if ((error_num = spider_db_mbase_utility->append_lock_table_tail(str)))
|
||||||
{
|
{
|
||||||
@@ -13012,15 +13007,8 @@ int spider_mbase_handler::insert_lock_tables_list(
|
|||||||
DBUG_PRINT("info",("spider this=%p", this));
|
DBUG_PRINT("info",("spider this=%p", this));
|
||||||
uint old_elements =
|
uint old_elements =
|
||||||
db_conn->lock_table_hash.array.max_element;
|
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,
|
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash2))
|
(uchar*) tmp_link_for_hash2))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
}
|
}
|
||||||
@@ -13067,26 +13055,12 @@ int spider_mbase_handler::append_lock_tables_list(
|
|||||||
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
||||||
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,
|
my_hash_delete(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash);
|
(uchar*) tmp_link_for_hash);
|
||||||
#endif
|
|
||||||
uint old_elements =
|
uint old_elements =
|
||||||
db_conn->lock_table_hash.array.max_element;
|
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,
|
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash2))
|
(uchar*) tmp_link_for_hash2))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
}
|
}
|
||||||
|
@@ -2350,12 +2350,7 @@ int spider_db_oracle::append_lock_tables(
|
|||||||
my_hash_reset(&lock_table_hash);
|
my_hash_reset(&lock_table_hash);
|
||||||
DBUG_RETURN(error_num);
|
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);
|
my_hash_delete(&lock_table_hash, (uchar*) tmp_link_for_hash);
|
||||||
#endif
|
|
||||||
|
|
||||||
if ((error_num = spider_db_oracle_utility.append_lock_table_tail(str)))
|
if ((error_num = spider_db_oracle_utility.append_lock_table_tail(str)))
|
||||||
{
|
{
|
||||||
@@ -10282,15 +10277,8 @@ int spider_oracle_handler::insert_lock_tables_list(
|
|||||||
DBUG_PRINT("info",("spider this=%p", this));
|
DBUG_PRINT("info",("spider this=%p", this));
|
||||||
uint old_elements =
|
uint old_elements =
|
||||||
db_conn->lock_table_hash.array.max_element;
|
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,
|
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash2))
|
(uchar*) tmp_link_for_hash2))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
}
|
}
|
||||||
@@ -10334,26 +10322,12 @@ int spider_oracle_handler::append_lock_tables_list(
|
|||||||
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
if (tmp_link_for_hash->spider->wide_handler->lock_type <
|
||||||
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,
|
my_hash_delete(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash);
|
(uchar*) tmp_link_for_hash);
|
||||||
#endif
|
|
||||||
uint old_elements =
|
uint old_elements =
|
||||||
db_conn->lock_table_hash.array.max_element;
|
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,
|
if (my_hash_insert(&db_conn->lock_table_hash,
|
||||||
(uchar*) tmp_link_for_hash2))
|
(uchar*) tmp_link_for_hash2))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
}
|
}
|
||||||
|
@@ -522,12 +522,7 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
|||||||
error_num)))
|
error_num)))
|
||||||
goto error;
|
goto error;
|
||||||
} else {
|
} 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);
|
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||||
#endif
|
|
||||||
pthread_mutex_unlock(&spider_conn_mutex);
|
pthread_mutex_unlock(&spider_conn_mutex);
|
||||||
DBUG_PRINT("info",("spider get global conn"));
|
DBUG_PRINT("info",("spider get global conn"));
|
||||||
}
|
}
|
||||||
@@ -541,12 +536,7 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
|||||||
conn->priority = direct_sql->priority;
|
conn->priority = direct_sql->priority;
|
||||||
|
|
||||||
uint old_elements = trx->trx_conn_hash.array.max_element;
|
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))
|
if (my_hash_insert(&trx->trx_conn_hash, (uchar*) conn))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_free_conn(conn);
|
spider_free_conn(conn);
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
|
@@ -159,14 +159,8 @@ SPIDER_TABLE_MON_LIST *spider_get_ping_table_mon_list(
|
|||||||
uint old_elements =
|
uint old_elements =
|
||||||
spider_udf_table_mon_list_hash[mutex_hash].array.max_element;
|
spider_udf_table_mon_list_hash[mutex_hash].array.max_element;
|
||||||
table_mon_list->key_hash_value = hash_value;
|
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],
|
if (my_hash_insert(&spider_udf_table_mon_list_hash[mutex_hash],
|
||||||
(uchar*) table_mon_list))
|
(uchar*) table_mon_list))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_ping_table_free_mon_list(table_mon_list);
|
spider_ping_table_free_mon_list(table_mon_list);
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
@@ -215,13 +209,8 @@ void spider_release_ping_table_mon_list_loop(
|
|||||||
SPIDER_TABLE_MON_LIST *table_mon_list
|
SPIDER_TABLE_MON_LIST *table_mon_list
|
||||||
) {
|
) {
|
||||||
DBUG_ENTER("spider_release_ping_table_mon_list_loop");
|
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],
|
my_hash_delete(&spider_udf_table_mon_list_hash[mutex_hash],
|
||||||
(uchar*) table_mon_list);
|
(uchar*) table_mon_list);
|
||||||
#endif
|
|
||||||
while (TRUE)
|
while (TRUE)
|
||||||
{
|
{
|
||||||
if (table_mon_list->use_count)
|
if (table_mon_list->use_count)
|
||||||
|
@@ -4321,12 +4321,7 @@ SPIDER_SHARE *spider_get_share(
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint old_elements = spider_open_tables.array.max_element;
|
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))
|
if (my_hash_insert(&spider_open_tables, (uchar*) share))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
goto error_hash_insert;
|
goto error_hash_insert;
|
||||||
@@ -4479,14 +4474,9 @@ SPIDER_SHARE *spider_get_share(
|
|||||||
spider_free_share(share);
|
spider_free_share(share);
|
||||||
goto error_sts_spider_init;
|
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[
|
share->sts_thread = &spider_table_sts_threads[
|
||||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||||
spider_param_table_sts_thread_count()];
|
spider_param_table_sts_thread_count()];
|
||||||
#endif
|
|
||||||
share->sts_spider_init = TRUE;
|
share->sts_spider_init = TRUE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&share->mutex);
|
pthread_mutex_unlock(&share->mutex);
|
||||||
@@ -4507,14 +4497,9 @@ SPIDER_SHARE *spider_get_share(
|
|||||||
spider_free_share(share);
|
spider_free_share(share);
|
||||||
goto error_crd_spider_init;
|
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[
|
share->crd_thread = &spider_table_crd_threads[
|
||||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||||
spider_param_table_crd_thread_count()];
|
spider_param_table_crd_thread_count()];
|
||||||
#endif
|
|
||||||
share->crd_spider_init = TRUE;
|
share->crd_spider_init = TRUE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&share->mutex);
|
pthread_mutex_unlock(&share->mutex);
|
||||||
@@ -4973,14 +4958,9 @@ SPIDER_SHARE *spider_get_share(
|
|||||||
spider_free_share(share);
|
spider_free_share(share);
|
||||||
goto error_sts_spider_init;
|
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[
|
share->sts_thread = &spider_table_sts_threads[
|
||||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||||
spider_param_table_sts_thread_count()];
|
spider_param_table_sts_thread_count()];
|
||||||
#endif
|
|
||||||
share->sts_spider_init = TRUE;
|
share->sts_spider_init = TRUE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&share->mutex);
|
pthread_mutex_unlock(&share->mutex);
|
||||||
@@ -4998,14 +4978,9 @@ SPIDER_SHARE *spider_get_share(
|
|||||||
spider_free_share(share);
|
spider_free_share(share);
|
||||||
goto error_crd_spider_init;
|
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[
|
share->crd_thread = &spider_table_crd_threads[
|
||||||
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
my_calc_hash(&spider_open_tables, (uchar*) table_name, length) %
|
||||||
spider_param_table_crd_thread_count()];
|
spider_param_table_crd_thread_count()];
|
||||||
#endif
|
|
||||||
share->crd_spider_init = TRUE;
|
share->crd_spider_init = TRUE;
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&share->mutex);
|
pthread_mutex_unlock(&share->mutex);
|
||||||
@@ -5368,12 +5343,7 @@ int spider_free_share(
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
spider_free_share_alloc(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);
|
my_hash_delete(&spider_open_tables, (uchar*) share);
|
||||||
#endif
|
|
||||||
pthread_mutex_destroy(&share->crd_mutex);
|
pthread_mutex_destroy(&share->crd_mutex);
|
||||||
pthread_mutex_destroy(&share->sts_mutex);
|
pthread_mutex_destroy(&share->sts_mutex);
|
||||||
pthread_mutex_destroy(&share->mutex);
|
pthread_mutex_destroy(&share->mutex);
|
||||||
@@ -5458,13 +5428,8 @@ SPIDER_LGTM_TBLHND_SHARE *spider_get_lgtm_tblhnd_share(
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint old_elements = spider_lgtm_tblhnd_share_hash.array.max_element;
|
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,
|
if (my_hash_insert(&spider_lgtm_tblhnd_share_hash,
|
||||||
(uchar*) lgtm_tblhnd_share))
|
(uchar*) lgtm_tblhnd_share))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
goto error_hash_insert;
|
goto error_hash_insert;
|
||||||
@@ -5500,12 +5465,7 @@ void spider_free_lgtm_tblhnd_share_alloc(
|
|||||||
DBUG_ENTER("spider_free_lgtm_tblhnd_share");
|
DBUG_ENTER("spider_free_lgtm_tblhnd_share");
|
||||||
if (!locked)
|
if (!locked)
|
||||||
pthread_mutex_lock(&spider_lgtm_tblhnd_share_mutex);
|
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);
|
my_hash_delete(&spider_lgtm_tblhnd_share_hash, (uchar*) lgtm_tblhnd_share);
|
||||||
#endif
|
|
||||||
pthread_mutex_destroy(&lgtm_tblhnd_share->auto_increment_mutex);
|
pthread_mutex_destroy(&lgtm_tblhnd_share->auto_increment_mutex);
|
||||||
spider_free(spider_current_trx, lgtm_tblhnd_share, MYF(0));
|
spider_free(spider_current_trx, lgtm_tblhnd_share, MYF(0));
|
||||||
if (!locked)
|
if (!locked)
|
||||||
@@ -5570,13 +5530,7 @@ SPIDER_WIDE_SHARE *spider_get_wide_share(
|
|||||||
thr_lock_init(&wide_share->lock);
|
thr_lock_init(&wide_share->lock);
|
||||||
|
|
||||||
uint old_elements = spider_open_wide_share.array.max_element;
|
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))
|
if (my_hash_insert(&spider_open_wide_share, (uchar*) wide_share))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
*error_num = HA_ERR_OUT_OF_MEM;
|
*error_num = HA_ERR_OUT_OF_MEM;
|
||||||
goto error_hash_insert;
|
goto error_hash_insert;
|
||||||
@@ -5614,12 +5568,7 @@ int spider_free_wide_share(
|
|||||||
if (!--wide_share->use_count)
|
if (!--wide_share->use_count)
|
||||||
{
|
{
|
||||||
thr_lock_delete(&wide_share->lock);
|
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);
|
my_hash_delete(&spider_open_wide_share, (uchar*) wide_share);
|
||||||
#endif
|
|
||||||
pthread_mutex_destroy(&wide_share->crd_mutex);
|
pthread_mutex_destroy(&wide_share->crd_mutex);
|
||||||
pthread_mutex_destroy(&wide_share->sts_mutex);
|
pthread_mutex_destroy(&wide_share->sts_mutex);
|
||||||
spider_free(spider_current_trx, wide_share, MYF(0));
|
spider_free(spider_current_trx, wide_share, MYF(0));
|
||||||
@@ -6087,14 +6036,8 @@ int spider_db_done(
|
|||||||
while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element(
|
while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element(
|
||||||
&spider_udf_table_mon_list_hash[roop_count], 0)))
|
&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],
|
my_hash_delete(&spider_udf_table_mon_list_hash[roop_count],
|
||||||
(uchar*) table_mon_list);
|
(uchar*) table_mon_list);
|
||||||
#endif
|
|
||||||
spider_ping_table_free_mon_list(table_mon_list);
|
spider_ping_table_free_mon_list(table_mon_list);
|
||||||
}
|
}
|
||||||
spider_free_mem_calc(spider_current_trx,
|
spider_free_mem_calc(spider_current_trx,
|
||||||
@@ -6130,12 +6073,7 @@ int spider_db_done(
|
|||||||
pthread_mutex_lock(&spider_conn_mutex);
|
pthread_mutex_lock(&spider_conn_mutex);
|
||||||
while ((conn = (SPIDER_CONN*) my_hash_element(&spider_open_connections, 0)))
|
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);
|
my_hash_delete(&spider_open_connections, (uchar*) conn);
|
||||||
#endif
|
|
||||||
spider_free_conn(conn);
|
spider_free_conn(conn);
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&spider_conn_mutex);
|
pthread_mutex_unlock(&spider_conn_mutex);
|
||||||
@@ -6178,14 +6116,8 @@ int spider_db_done(
|
|||||||
while ((spider_init_error_table = (SPIDER_INIT_ERROR_TABLE*)
|
while ((spider_init_error_table = (SPIDER_INIT_ERROR_TABLE*)
|
||||||
my_hash_element(&spider_init_error_tables, 0)))
|
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,
|
my_hash_delete(&spider_init_error_tables,
|
||||||
(uchar*) spider_init_error_table);
|
(uchar*) spider_init_error_table);
|
||||||
#endif
|
|
||||||
spider_free(NULL, spider_init_error_table, MYF(0));
|
spider_free(NULL, spider_init_error_table, MYF(0));
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||||
@@ -7206,13 +7138,8 @@ SPIDER_INIT_ERROR_TABLE *spider_get_init_error_table(
|
|||||||
spider_init_error_table->table_name_hash_value =
|
spider_init_error_table->table_name_hash_value =
|
||||||
share->table_name_hash_value;
|
share->table_name_hash_value;
|
||||||
uint old_elements = spider_init_error_tables.array.max_element;
|
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,
|
if (my_hash_insert(&spider_init_error_tables,
|
||||||
(uchar*) spider_init_error_table))
|
(uchar*) spider_init_error_table))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_free(trx, spider_init_error_table, MYF(0));
|
spider_free(trx, spider_init_error_table, MYF(0));
|
||||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||||
@@ -7243,14 +7170,8 @@ void spider_delete_init_error_table(
|
|||||||
my_hash_search_using_hash_value(&spider_init_error_tables, hash_value,
|
my_hash_search_using_hash_value(&spider_init_error_tables, hash_value,
|
||||||
(uchar*) name, length)))
|
(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,
|
my_hash_delete(&spider_init_error_tables,
|
||||||
(uchar*) spider_init_error_table);
|
(uchar*) spider_init_error_table);
|
||||||
#endif
|
|
||||||
spider_free(spider_current_trx, spider_init_error_table, MYF(0));
|
spider_free(spider_current_trx, spider_init_error_table, MYF(0));
|
||||||
}
|
}
|
||||||
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
pthread_mutex_unlock(&spider_init_error_tbl_mutex);
|
||||||
|
@@ -378,12 +378,7 @@ void spider_free_trx_alter_table_alloc(
|
|||||||
SPIDER_ALTER_TABLE *alter_table
|
SPIDER_ALTER_TABLE *alter_table
|
||||||
) {
|
) {
|
||||||
DBUG_ENTER("spider_free_trx_alter_table_alloc");
|
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);
|
my_hash_delete(&trx->trx_alter_table_hash, (uchar*) alter_table);
|
||||||
#endif
|
|
||||||
if (alter_table->tmp_char)
|
if (alter_table->tmp_char)
|
||||||
spider_free(trx, alter_table->tmp_char, MYF(0));
|
spider_free(trx, alter_table->tmp_char, MYF(0));
|
||||||
spider_free(trx, alter_table, MYF(0));
|
spider_free(trx, alter_table, MYF(0));
|
||||||
@@ -799,12 +794,7 @@ int spider_create_trx_alter_table(
|
|||||||
share_alter->tmp_link_statuses_length;
|
share_alter->tmp_link_statuses_length;
|
||||||
|
|
||||||
old_elements = trx->trx_alter_table_hash.array.max_element;
|
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))
|
if (my_hash_insert(&trx->trx_alter_table_hash, (uchar*) alter_table))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
error_num = HA_ERR_OUT_OF_MEM;
|
error_num = HA_ERR_OUT_OF_MEM;
|
||||||
goto error;
|
goto error;
|
||||||
@@ -1277,12 +1267,7 @@ SPIDER_TRX *spider_get_trx(
|
|||||||
{
|
{
|
||||||
pthread_mutex_lock(&spider_allocated_thds_mutex);
|
pthread_mutex_lock(&spider_allocated_thds_mutex);
|
||||||
uint old_elements = spider_allocated_thds.array.max_element;
|
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))
|
if (my_hash_insert(&spider_allocated_thds, (uchar*) thd))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
||||||
goto error_allocated_thds_insert;
|
goto error_allocated_thds_insert;
|
||||||
@@ -1388,12 +1373,7 @@ int spider_free_trx(
|
|||||||
{
|
{
|
||||||
if (need_lock)
|
if (need_lock)
|
||||||
pthread_mutex_lock(&spider_allocated_thds_mutex);
|
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);
|
my_hash_delete(&spider_allocated_thds, (uchar*) trx->thd);
|
||||||
#endif
|
|
||||||
if (need_lock)
|
if (need_lock)
|
||||||
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
pthread_mutex_unlock(&spider_allocated_thds_mutex);
|
||||||
}
|
}
|
||||||
@@ -1552,17 +1532,7 @@ static int spider_xa_lock(
|
|||||||
error_num = ER_SPIDER_XA_LOCKED_NUM;
|
error_num = ER_SPIDER_XA_LOCKED_NUM;
|
||||||
goto error;
|
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))
|
if (my_hash_insert(spd_db_att_xid_cache, (uchar*)xid_state))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
error_num = HA_ERR_OUT_OF_MEM;
|
error_num = HA_ERR_OUT_OF_MEM;
|
||||||
goto error;
|
goto error;
|
||||||
@@ -1597,13 +1567,6 @@ static int spider_xa_unlock(
|
|||||||
DBUG_ENTER("spider_xa_unlock");
|
DBUG_ENTER("spider_xa_unlock");
|
||||||
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
||||||
#else
|
#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
|
#endif
|
||||||
old_proc_info = thd_proc_info(thd, "Unlocking xid by Spider");
|
old_proc_info = thd_proc_info(thd, "Unlocking xid by Spider");
|
||||||
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
#ifdef SPIDER_XID_USES_xid_cache_iterate
|
||||||
@@ -1614,17 +1577,7 @@ static int spider_xa_unlock(
|
|||||||
#else
|
#else
|
||||||
pthread_mutex_lock(spd_db_att_LOCK_xid_cache);
|
pthread_mutex_lock(spd_db_att_LOCK_xid_cache);
|
||||||
#endif
|
#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);
|
my_hash_delete(spd_db_att_xid_cache, (uchar *)xid_state);
|
||||||
#endif
|
|
||||||
#ifdef XID_CACHE_IS_SPLITTED
|
#ifdef XID_CACHE_IS_SPLITTED
|
||||||
pthread_mutex_unlock(&spd_db_att_LOCK_xid_cache[idx]);
|
pthread_mutex_unlock(&spd_db_att_LOCK_xid_cache[idx]);
|
||||||
#else
|
#else
|
||||||
@@ -3785,12 +3738,7 @@ int spider_create_trx_ha(
|
|||||||
) {
|
) {
|
||||||
DBUG_PRINT("info",("spider need recreate"));
|
DBUG_PRINT("info",("spider need recreate"));
|
||||||
need_create = TRUE;
|
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);
|
my_hash_delete(&trx->trx_ha_hash, (uchar*) trx_ha);
|
||||||
#endif
|
|
||||||
spider_free(trx, trx_ha, MYF(0));
|
spider_free(trx, trx_ha, MYF(0));
|
||||||
} else {
|
} else {
|
||||||
DBUG_PRINT("info",("spider use this"));
|
DBUG_PRINT("info",("spider use this"));
|
||||||
@@ -3820,12 +3768,7 @@ int spider_create_trx_ha(
|
|||||||
trx_ha->conn_can_fo = conn_can_fo;
|
trx_ha->conn_can_fo = conn_can_fo;
|
||||||
trx_ha->wait_for_reusing = FALSE;
|
trx_ha->wait_for_reusing = FALSE;
|
||||||
uint old_elements = trx->trx_ha_hash.array.max_element;
|
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))
|
if (my_hash_insert(&trx->trx_ha_hash, (uchar*) trx_ha))
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
spider_free(trx, trx_ha, MYF(0));
|
spider_free(trx, trx_ha, MYF(0));
|
||||||
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
DBUG_RETURN(HA_ERR_OUT_OF_MEM);
|
||||||
|
Reference in New Issue
Block a user