mirror of
https://github.com/MariaDB/server.git
synced 2025-08-08 11:22:35 +03:00
MDEV-27646 Spider: remove #ifdef SPIDER_HAS_HASH_VALUE_TYPE
This commit is contained in:
@@ -359,10 +359,8 @@ int spider_udf_direct_sql_create_conn_key(
|
||||
tmp_name = strmov(tmp_name + 1, direct_sql->tgt_driver);
|
||||
} else
|
||||
tmp_name++;
|
||||
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
|
||||
direct_sql->conn_key_hash_value = my_calc_hash(&spider_open_connections,
|
||||
(uchar*) direct_sql->conn_key, direct_sql->conn_key_length);
|
||||
#endif
|
||||
DBUG_RETURN(0);
|
||||
}
|
||||
|
||||
@@ -577,14 +575,9 @@ SPIDER_CONN *spider_udf_direct_sql_create_conn(
|
||||
pthread_mutex_unlock(&spider_conn_id_mutex);
|
||||
|
||||
pthread_mutex_lock(&spider_ipport_conn_mutex);
|
||||
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
|
||||
if ((ip_port_conn = (SPIDER_IP_PORT_CONN*) my_hash_search_using_hash_value(
|
||||
&spider_ipport_conns, conn->conn_key_hash_value,
|
||||
(uchar*)conn->conn_key, conn->conn_key_length)))
|
||||
#else
|
||||
if ((ip_port_conn = (SPIDER_IP_PORT_CONN*) my_hash_search(
|
||||
&spider_ipport_conns, (uchar*)conn->conn_key, conn->conn_key_length)))
|
||||
#endif
|
||||
{ /* exists, +1 */
|
||||
pthread_mutex_unlock(&spider_ipport_conn_mutex);
|
||||
pthread_mutex_lock(&ip_port_conn->mutex);
|
||||
@@ -641,18 +634,11 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
||||
SPIDER_CONN *conn = NULL;
|
||||
DBUG_ENTER("spider_udf_direct_sql_get_conn");
|
||||
|
||||
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
|
||||
if (
|
||||
!(conn = (SPIDER_CONN*) my_hash_search_using_hash_value(
|
||||
&trx->trx_conn_hash, direct_sql->conn_key_hash_value,
|
||||
(uchar*) direct_sql->conn_key, direct_sql->conn_key_length))
|
||||
)
|
||||
#else
|
||||
if (
|
||||
!(conn = (SPIDER_CONN*) my_hash_search(&trx->trx_conn_hash,
|
||||
(uchar*) direct_sql->conn_key, direct_sql->conn_key_length))
|
||||
)
|
||||
#endif
|
||||
{
|
||||
if (
|
||||
(
|
||||
@@ -661,14 +647,9 @@ SPIDER_CONN *spider_udf_direct_sql_get_conn(
|
||||
)
|
||||
) {
|
||||
pthread_mutex_lock(&spider_conn_mutex);
|
||||
#ifdef SPIDER_HAS_HASH_VALUE_TYPE
|
||||
if (!(conn = (SPIDER_CONN*) my_hash_search_using_hash_value(
|
||||
&spider_open_connections, direct_sql->conn_key_hash_value,
|
||||
(uchar*) direct_sql->conn_key, direct_sql->conn_key_length)))
|
||||
#else
|
||||
if (!(conn = (SPIDER_CONN*) my_hash_search(&spider_open_connections,
|
||||
(uchar*) direct_sql->conn_key, direct_sql->conn_key_length)))
|
||||
#endif
|
||||
{
|
||||
pthread_mutex_unlock(&spider_conn_mutex);
|
||||
DBUG_PRINT("info",("spider create new conn"));
|
||||
|
Reference in New Issue
Block a user