summaryrefslogtreecommitdiff
path: root/storage/spider/spd_table.cc
diff options
context:
space:
mode:
Diffstat (limited to 'storage/spider/spd_table.cc')
-rw-r--r--storage/spider/spd_table.cc105
1 files changed, 29 insertions, 76 deletions
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index 4f047effe67..8569027f09c 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -817,8 +817,6 @@ int spider_free_share_alloc(
spider_free(spider_current_trx, share->monitoring_flag, MYF(0));
if (share->monitoring_kind)
spider_free(spider_current_trx, share->monitoring_kind, MYF(0));
- if (share->use_handlers)
- spider_free(spider_current_trx, share->use_handlers, MYF(0));
if (share->connect_timeouts)
spider_free(spider_current_trx, share->connect_timeouts, MYF(0));
if (share->net_read_timeouts)
@@ -2347,8 +2345,6 @@ int spider_parse_connect_info(
option_struct &&
option_struct->remote_table);
SPIDER_PARAM_INT_WITH_MAX("tcm", table_count_mode, 0, 3);
- SPIDER_PARAM_DEPRECATED_WARNING("uhd");
- SPIDER_PARAM_LONG_LIST_WITH_MAX("uhd", use_handlers, 0, 3);
SPIDER_PARAM_INT_WITH_MAX("upu", use_pushdown_udf, 0, 1);
SPIDER_PARAM_INT_WITH_MAX("utc", use_table_charset, 0, 1);
error_num = connect_string_parse.print_param_error();
@@ -2427,8 +2423,6 @@ int spider_parse_connect_info(
SPIDER_PARAM_INT_WITH_MAX("crd_bg_mode", crd_bg_mode, 0, 2);
SPIDER_PARAM_INT_WITH_MAX("sts_bg_mode", sts_bg_mode, 0, 2);
SPIDER_PARAM_LONG_LIST_WITH_MAX("link_status", link_statuses, 0, 3);
- SPIDER_PARAM_DEPRECATED_WARNING("use_handler");
- SPIDER_PARAM_LONG_LIST_WITH_MAX("use_handler", use_handlers, 0, 3);
SPIDER_PARAM_INT_WITH_MAX("casual_read", casual_read, 0, 63);
SPIDER_PARAM_DEPRECATED_WARNING("buffer_size");
SPIDER_PARAM_INT("buffer_size", buffer_size, 0);
@@ -2673,8 +2667,6 @@ int spider_parse_connect_info(
share->all_link_count = share->monitoring_bg_kind_length;
if (share->all_link_count < share->monitoring_bg_interval_length)
share->all_link_count = share->monitoring_bg_interval_length;
- if (share->all_link_count < share->use_handlers_length)
- share->all_link_count = share->use_handlers_length;
if (share->all_link_count < share->connect_timeouts_length)
share->all_link_count = share->connect_timeouts_length;
if (share->all_link_count < share->net_read_timeouts_length)
@@ -2890,11 +2882,6 @@ int spider_parse_connect_info(
share->all_link_count)))
goto error;
if ((error_num = spider_increase_long_list(
- &share->use_handlers,
- &share->use_handlers_length,
- share->all_link_count)))
- goto error;
- if ((error_num = spider_increase_long_list(
&share->connect_timeouts,
&share->connect_timeouts_length,
share->all_link_count)))
@@ -3819,8 +3806,6 @@ int spider_set_connect_info_default(
if (share->monitoring_sid[roop_count] == -1)
share->monitoring_sid[roop_count] = global_system_variables.server_id;
- if (share->use_handlers[roop_count] == -1)
- share->use_handlers[roop_count] = 0;
if (share->connect_timeouts[roop_count] == -1)
share->connect_timeouts[roop_count] = 6;
if (share->net_read_timeouts[roop_count] == -1)
@@ -4401,7 +4386,7 @@ SPIDER_SHARE *spider_create_share(
(uint) (sizeof(*tmp_cardinality_upd) * bitmap_size),
&tmp_table_mon_mutex_bitmap,
(uint) (sizeof(*tmp_table_mon_mutex_bitmap) *
- ((spider_param_udf_table_mon_mutex_count() + 7) / 8)),
+ ((spider_udf_table_mon_mutex_count + 7) / 8)),
NullS))
) {
*error_num = HA_ERR_OUT_OF_MEM;
@@ -4451,7 +4436,7 @@ SPIDER_SHARE *spider_create_share(
buf_pos = strmov(buf_pos, link_idx_str);
*buf_pos = '\0';
spider_set_bit(tmp_table_mon_mutex_bitmap,
- spider_udf_calc_hash(buf, spider_param_udf_table_mon_mutex_count())
+ spider_udf_calc_hash(buf, spider_udf_table_mon_mutex_count)
);
}
@@ -4573,7 +4558,7 @@ SPIDER_SHARE *spider_get_share(
TABLE_SHARE *table_share = table->s;
SPIDER_RESULT_LIST *result_list = &spider->result_list;
uint length, tmp_conn_link_idx = 0, buf_sz;
- char *tmp_name, *tmp_cid;
+ char *tmp_name;
int roop_count;
double sts_interval;
int sts_mode;
@@ -4682,7 +4667,7 @@ SPIDER_SHARE *spider_get_share(
{
pthread_mutex_lock(&share->mutex);
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4714,7 +4699,7 @@ SPIDER_SHARE *spider_get_share(
FALSE, error_num))
) {
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4736,7 +4721,7 @@ SPIDER_SHARE *spider_get_share(
*error_num != HA_ERR_END_OF_FILE
) {
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4769,7 +4754,7 @@ SPIDER_SHARE *spider_get_share(
}
}
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -4864,16 +4849,10 @@ SPIDER_SHARE *spider_get_share(
&spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
&spider->conn_link_idx, sizeof(uint) * share->link_count,
&spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->sql_kind, sizeof(uint) * share->link_count,
&spider->connection_ids, sizeof(ulonglong) * share->link_count,
&spider->conn_kind, sizeof(uint) * share->link_count,
&spider->db_request_id, sizeof(ulonglong) * share->link_count,
&spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->m_handler_opened, sizeof(uchar) * share->link_bitmap_size,
- &spider->m_handler_id, sizeof(uint) * share->link_count,
- &spider->m_handler_cid, sizeof(char *) * share->link_count,
- &tmp_cid, sizeof(char) * (SPIDER_SQL_HANDLER_CID_LEN + 1) *
- share->link_count,
&spider->need_mons, sizeof(int) * share->link_count,
&spider->quick_targets, sizeof(void *) * share->link_count,
&result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
@@ -4883,7 +4862,6 @@ SPIDER_SHARE *spider_get_share(
sizeof(uchar) * share->link_bitmap_size,
&result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size,
- &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&result_list->casual_read, sizeof(int) * share->link_count,
&spider->dbton_handler,
sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
@@ -4903,8 +4881,6 @@ SPIDER_SHARE *spider_get_share(
spider->conn_keys[roop_count] = tmp_name;
*tmp_name = first_byte;
tmp_name += share->conn_keys_lengths[roop_count] + 1;
- spider->m_handler_cid[roop_count] = tmp_cid;
- tmp_cid += SPIDER_SQL_HANDLER_CID_LEN + 1;
result_list->upd_tmp_tbl_prms[roop_count].init();
result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
spider->conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
@@ -5162,7 +5138,7 @@ SPIDER_SHARE *spider_get_share(
{
pthread_mutex_lock(&share->mutex);
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5195,7 +5171,7 @@ SPIDER_SHARE *spider_get_share(
FALSE, error_num))
) {
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5214,7 +5190,7 @@ SPIDER_SHARE *spider_get_share(
*error_num != HA_ERR_END_OF_FILE
) {
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5244,7 +5220,7 @@ SPIDER_SHARE *spider_get_share(
}
}
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++
) {
if (spider_bit_is_set(share->table_mon_mutex_bitmap, roop_count))
@@ -5328,16 +5304,10 @@ SPIDER_SHARE *spider_get_share(
&spider->conns, sizeof(SPIDER_CONN *) * share->link_count,
&spider->conn_link_idx, sizeof(uint) * share->link_count,
&spider->conn_can_fo, sizeof(uchar) * share->link_bitmap_size,
- &spider->sql_kind, sizeof(uint) * share->link_count,
&spider->connection_ids, sizeof(ulonglong) * share->link_count,
&spider->conn_kind, sizeof(uint) * share->link_count,
&spider->db_request_id, sizeof(ulonglong) * share->link_count,
&spider->db_request_phase, sizeof(uchar) * share->link_bitmap_size,
- &spider->m_handler_opened, sizeof(uchar) * share->link_bitmap_size,
- &spider->m_handler_id, sizeof(uint) * share->link_count,
- &spider->m_handler_cid, sizeof(char *) * share->link_count,
- &tmp_cid, sizeof(char) * (SPIDER_SQL_HANDLER_CID_LEN + 1) *
- share->link_count,
&spider->need_mons, sizeof(int) * share->link_count,
&spider->quick_targets, sizeof(void *) * share->link_count,
&result_list->upd_tmp_tbls, sizeof(TABLE *) * share->link_count,
@@ -5347,7 +5317,6 @@ SPIDER_SHARE *spider_get_share(
sizeof(uchar) * share->link_bitmap_size,
&result_list->tmp_table_created,
sizeof(uchar) * share->link_bitmap_size,
- &result_list->sql_kind_backup, sizeof(uint) * share->link_count,
&result_list->casual_read, sizeof(int) * share->link_count,
&spider->dbton_handler,
sizeof(spider_db_handler *) * SPIDER_DBTON_SIZE,
@@ -5364,8 +5333,6 @@ SPIDER_SHARE *spider_get_share(
spider->conn_keys[roop_count] = tmp_name;
*tmp_name = first_byte;
tmp_name += share->conn_keys_lengths[roop_count] + 1;
- spider->m_handler_cid[roop_count] = tmp_cid;
- tmp_cid += SPIDER_SQL_HANDLER_CID_LEN + 1;
result_list->upd_tmp_tbl_prms[roop_count].init();
result_list->upd_tmp_tbl_prms[roop_count].field_count = 1;
spider->conn_kind[roop_count] = SPIDER_CONN_KIND_MYSQL;
@@ -6414,7 +6381,7 @@ int spider_db_done(
}
spider_free(NULL, spider_table_sts_threads, MYF(0));
- for (roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--)
{
while ((table_mon_list = (SPIDER_TABLE_MON_LIST *) my_hash_element(
@@ -6430,10 +6397,10 @@ int spider_db_done(
spider_udf_table_mon_list_hash[roop_count].array.size_of_element);
my_hash_free(&spider_udf_table_mon_list_hash[roop_count]);
}
- for (roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--)
pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]);
- for (roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ for (roop_count= spider_udf_table_mon_mutex_count - 1;
roop_count >= 0; roop_count--)
pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]);
spider_free(NULL, spider_udf_table_mon_mutexes, MYF(0));
@@ -6784,17 +6751,17 @@ int spider_db_init(
if (!(spider_udf_table_mon_mutexes = (pthread_mutex_t *)
spider_bulk_malloc(NULL, 53, MYF(MY_WME | MY_ZEROFILL),
&spider_udf_table_mon_mutexes, (uint) (sizeof(pthread_mutex_t) *
- spider_param_udf_table_mon_mutex_count()),
+ spider_udf_table_mon_mutex_count),
&spider_udf_table_mon_conds, (uint) (sizeof(pthread_cond_t) *
- spider_param_udf_table_mon_mutex_count()),
+ spider_udf_table_mon_mutex_count),
&spider_udf_table_mon_list_hash, (uint) (sizeof(HASH) *
- spider_param_udf_table_mon_mutex_count()),
+ spider_udf_table_mon_mutex_count),
NullS))
)
goto error_alloc_mon_mutxes;
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++)
{
if (mysql_mutex_init(spd_key_mutex_udf_table_mon,
@@ -6802,7 +6769,7 @@ int spider_db_init(
goto error_init_udf_table_mon_mutex;
}
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++)
{
if (mysql_cond_init(spd_key_cond_udf_table_mon,
@@ -6810,7 +6777,7 @@ int spider_db_init(
goto error_init_udf_table_mon_cond;
}
for (roop_count = 0;
- roop_count < (int) spider_param_udf_table_mon_mutex_count();
+ roop_count < (int) spider_udf_table_mon_mutex_count;
roop_count++)
{
if (my_hash_init(PSI_INSTRUMENT_ME, &spider_udf_table_mon_list_hash[roop_count],
@@ -6896,7 +6863,7 @@ error_init_table_sts_threads:
spider_free_sts_threads(&spider_table_sts_threads[roop_count]);
}
spider_free(NULL, spider_table_sts_threads, MYF(0));
- roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_list_hash:
for (; roop_count >= 0; roop_count--)
{
@@ -6906,11 +6873,11 @@ error_init_udf_table_mon_list_hash:
spider_udf_table_mon_list_hash[roop_count].array.size_of_element);
my_hash_free(&spider_udf_table_mon_list_hash[roop_count]);
}
- roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_cond:
for (; roop_count >= 0; roop_count--)
pthread_cond_destroy(&spider_udf_table_mon_conds[roop_count]);
- roop_count = spider_param_udf_table_mon_mutex_count() - 1;
+ roop_count= spider_udf_table_mon_mutex_count - 1;
error_init_udf_table_mon_mutex:
for (; roop_count >= 0; roop_count--)
pthread_mutex_destroy(&spider_udf_table_mon_mutexes[roop_count]);
@@ -7572,16 +7539,14 @@ void spider_set_tmp_share_pointer(
tmp_share->monitoring_kind = &tmp_long[5];
tmp_share->monitoring_bg_flag = &tmp_long[6];
tmp_share->monitoring_bg_kind = &tmp_long[7];
- tmp_share->use_handlers = &tmp_long[13];
- tmp_share->connect_timeouts = &tmp_long[14];
+ tmp_share->connect_timeouts = &tmp_long[13];
+ tmp_share->net_read_timeouts = &tmp_long[14];
tmp_long[13] = -1;
- tmp_share->net_read_timeouts = &tmp_long[15];
+ tmp_share->net_write_timeouts = &tmp_long[15];
tmp_long[14] = -1;
- tmp_share->net_write_timeouts = &tmp_long[16];
- tmp_long[15] = -1;
- tmp_share->access_balances = &tmp_long[17];
- tmp_share->bka_table_name_types = &tmp_long[18];
- tmp_share->strict_group_bys = &tmp_long[19];
+ tmp_share->access_balances = &tmp_long[16];
+ tmp_share->bka_table_name_types = &tmp_long[17];
+ tmp_share->strict_group_bys = &tmp_long[18];
tmp_share->monitoring_limit = &tmp_longlong[0];
tmp_share->monitoring_sid = &tmp_longlong[1];
tmp_share->monitoring_bg_interval = &tmp_longlong[2];
@@ -7638,7 +7603,6 @@ void spider_set_tmp_share_pointer(
tmp_share->monitoring_limit_length = 1;
tmp_share->monitoring_sid_length = 1;
tmp_share->monitoring_bg_interval_length = 1;
- tmp_share->use_handlers_length = 1;
tmp_share->connect_timeouts_length = 1;
tmp_share->net_read_timeouts_length = 1;
tmp_share->net_write_timeouts_length = 1;
@@ -7820,10 +7784,6 @@ longlong spider_split_read_param(
DBUG_RETURN(info_limit);
}
#endif
- if (spider->sql_kinds & SPIDER_SQL_KIND_HANDLER)
- {
- DBUG_RETURN(result_list->semi_split_read_base);
- }
spider_get_select_limit(spider, &select_lex, &select_limit, &offset_limit);
DBUG_PRINT("info",("spider result_list->set_split_read=%s", result_list->set_split_read ? "TRUE" : "FALSE"));
if (!result_list->set_split_read)
@@ -8051,8 +8011,6 @@ bool spider_check_direct_order_limit(
}
DBUG_PRINT("info",("spider SQLCOM_HA_READ=%s",
(spider->wide_handler->sql_command == SQLCOM_HA_READ) ? "TRUE" : "FALSE"));
- DBUG_PRINT("info",("spider sql_kinds with SPIDER_SQL_KIND_HANDLER=%s",
- (spider->sql_kinds & SPIDER_SQL_KIND_HANDLER) ? "TRUE" : "FALSE"));
DBUG_PRINT("info",("spider use_index_merge=%s",
spider->use_index_merge ? "TRUE" : "FALSE"));
DBUG_PRINT("info",("spider is_clone=%s",
@@ -8099,11 +8057,6 @@ bool spider_check_direct_order_limit(
first_check = FALSE;
spider->result_list.direct_distinct = FALSE;
spider->result_list.direct_aggregate = FALSE;
- } else if (spider->sql_kinds & SPIDER_SQL_KIND_HANDLER)
- {
- DBUG_PRINT("info",("spider sql_kinds with SPIDER_SQL_KIND_HANDLER"));
- spider->result_list.direct_distinct = FALSE;
- spider->result_list.direct_aggregate = FALSE;
} else if (
!select_lex->group_list.elements &&
!select_lex->with_sum_func