summaryrefslogtreecommitdiff
path: root/storage/spider
diff options
context:
space:
mode:
authorNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-01-28 15:57:07 +0900
committerNayuta Yanagisawa <nayuta.yanagisawa@hey.com>2022-02-10 14:58:26 +0900
commita4da96773de9646836985dfd8b58ea123afbbe93 (patch)
tree2f3902e22a0e8cfef2c464a744ec43b14f2c834e /storage/spider
parent00ae4272b3ffc99f3589bd8da497e20d51825ba1 (diff)
downloadmariadb-git-a4da96773de9646836985dfd8b58ea123afbbe93.tar.gz
MDEV-27643 Spider: remove #ifdef HA_CAN_BULK_ACCESS
Diffstat (limited to 'storage/spider')
-rw-r--r--storage/spider/ha_spider.cc1337
-rw-r--r--storage/spider/ha_spider.h159
-rw-r--r--storage/spider/spd_conn.cc14
-rw-r--r--storage/spider/spd_db_conn.cc238
-rw-r--r--storage/spider/spd_db_conn.h26
-rw-r--r--storage/spider/spd_db_mysql.cc4
-rw-r--r--storage/spider/spd_db_oracle.cc4
-rw-r--r--storage/spider/spd_include.h27
-rw-r--r--storage/spider/spd_param.cc31
-rw-r--r--storage/spider/spd_param.h5
-rw-r--r--storage/spider/spd_table.cc28
-rw-r--r--storage/spider/spd_trx.cc41
-rw-r--r--storage/spider/spd_trx.h6
13 files changed, 0 insertions, 1920 deletions
diff --git a/storage/spider/ha_spider.cc b/storage/spider/ha_spider.cc
index 76b6add9e17..ff0f6c425bc 100644
--- a/storage/spider/ha_spider.cc
+++ b/storage/spider/ha_spider.cc
@@ -101,17 +101,6 @@ ha_spider::ha_spider(
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
do_direct_update = FALSE;
#endif
-#ifdef HA_CAN_BULK_ACCESS
- is_bulk_access_clone = FALSE;
- synced_from_clone_source = FALSE;
- bulk_access_started = FALSE;
- bulk_access_executing = FALSE;
- bulk_access_pre_called = FALSE;
- bulk_access_link_first = NULL;
-/*
- init_ha_mem_root = FALSE;
-*/
-#endif
prev_index_rnd_init = SPD_NONE;
#ifdef HANDLER_HAS_DIRECT_AGGREGATE
direct_aggregate_item_first = NULL;
@@ -186,17 +175,6 @@ ha_spider::ha_spider(
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
do_direct_update = FALSE;
#endif
-#ifdef HA_CAN_BULK_ACCESS
- is_bulk_access_clone = FALSE;
- synced_from_clone_source = FALSE;
- bulk_access_started = FALSE;
- bulk_access_executing = FALSE;
- bulk_access_pre_called = FALSE;
- bulk_access_link_first = NULL;
-/*
- init_ha_mem_root = FALSE;
-*/
-#endif
prev_index_rnd_init = SPD_NONE;
#ifdef HANDLER_HAS_DIRECT_AGGREGATE
direct_aggregate_item_first = NULL;
@@ -523,9 +501,6 @@ int ha_spider::open(
wide_handler->semi_table_lock = TRUE;
}
}
-#ifdef HA_CAN_BULK_ACCESS
- external_lock_cnt = 0;
-#endif
if (reset())
{
@@ -596,22 +571,6 @@ int ha_spider::close()
mrr_key_buff = NULL;
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_link_first)
- {
- do {
- DBUG_PRINT("info",("spider bulk_access_link->spider=%p",
- bulk_access_link_first->spider));
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- bulk_access_link_first->spider->dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler="
- "%p", &bulk_access_link_first->spider->dbton_handler));
- bulk_access_link_current = bulk_access_link_first->next;
- delete_bulk_access_link(bulk_access_link_first);
- bulk_access_link_first = bulk_access_link_current;
- } while (bulk_access_link_first);
- }
-#endif
#ifdef HANDLER_HAS_DIRECT_AGGREGATE
while (direct_aggregate_item_first)
{
@@ -785,33 +744,6 @@ void ha_spider::check_access_kind(
DBUG_VOID_RETURN;
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::additional_lock(
- THD *thd,
- enum thr_lock_type lock_type
-) {
- DBUG_ENTER("ha_spider::additional_lock");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_executing)
- {
- if (is_bulk_access_clone)
- {
- check_access_kind(thd);
- DBUG_RETURN(check_access_kind_for_connection(thd,
- (lock_type >= TL_WRITE_ALLOW_WRITE)));
- } else if (bulk_access_link_exec_tgt->called)
- {
- bulk_access_link_exec_tgt->spider->check_access_kind(thd);
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->
- check_access_kind_for_connection(
- thd, (lock_type >= TL_WRITE_ALLOW_WRITE)));
- }
- }
- check_access_kind(thd);
- DBUG_RETURN(check_access_kind_for_connection(thd,
- (lock_type >= TL_WRITE_ALLOW_WRITE)));
-}
-#endif
THR_LOCK_DATA **ha_spider::store_lock(
THD *thd,
@@ -1043,9 +975,6 @@ int ha_spider::external_lock(
wide_handler->trx = trx;
DBUG_PRINT("info",("spider sql_command=%d", wide_handler->sql_command));
-#ifdef HA_CAN_BULK_ACCESS
- wide_handler->external_lock_cnt++;
-#endif
if (
lock_type == F_UNLCK &&
wide_handler->sql_command != SQLCOM_UNLOCK_TABLES
@@ -1167,40 +1096,6 @@ int ha_spider::reset()
backup_error_status();
DBUG_ENTER("ha_spider::reset");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- SPIDER_BULK_ACCESS_LINK *tmp_bulk_access_link = bulk_access_link_first;
- while (tmp_bulk_access_link)
- {
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- tmp_bulk_access_link->spider->dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
- &tmp_bulk_access_link->spider->dbton_handler));
- if (!tmp_bulk_access_link->used)
- break;
- if ((error_num2 = tmp_bulk_access_link->spider->ha_reset()))
- error_num = error_num2;
- tmp_bulk_access_link->used = FALSE;
- tmp_bulk_access_link = tmp_bulk_access_link->next;
- }
- synced_from_clone_source = FALSE;
- bulk_access_started = FALSE;
- bulk_access_executing = FALSE;
- bulk_access_pre_called = FALSE;
- if (
- bulk_access_link_first &&
- !spider_param_bulk_access_free(share->bulk_access_free)
- ) {
- do {
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- bulk_access_link_first->spider->dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
- &bulk_access_link_first->spider->dbton_handler));
- bulk_access_link_current = bulk_access_link_first->next;
- delete_bulk_access_link(bulk_access_link_first);
- bulk_access_link_first = bulk_access_link_current;
- } while (bulk_access_link_first);
- }
-#endif
#ifdef HANDLER_HAS_DIRECT_AGGREGATE
direct_aggregate_item_current = direct_aggregate_item_first;
while (direct_aggregate_item_current)
@@ -1351,17 +1246,6 @@ int ha_spider::reset()
use_fields = FALSE;
#endif
error_mode = 0;
-#ifdef HA_CAN_BULK_ACCESS
-#ifndef DBUG_OFF
- if (bulk_access_link_first)
- {
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- bulk_access_link_first->spider->dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
- &bulk_access_link_first->spider->dbton_handler));
- }
-#endif
-#endif
DBUG_RETURN(error_num);
}
@@ -1479,19 +1363,6 @@ int ha_spider::index_init(
DBUG_ENTER("ha_spider::index_init");
DBUG_PRINT("info",("spider this=%p", this));
DBUG_PRINT("info",("spider idx=%u", idx));
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->ha_index_init(
- idx, sorted));
- }
- }
-#endif
if (!dml_inited)
{
if (unlikely((error_num = dml_init())))
@@ -1540,16 +1411,6 @@ int ha_spider::index_init(
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::pre_index_init(
- uint idx,
- bool sorted
-) {
- DBUG_ENTER("ha_spider::pre_index_init");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_index_init(idx, sorted));
-}
-#endif
int ha_spider::index_end()
{
@@ -1557,21 +1418,6 @@ int ha_spider::index_end()
backup_error_status();
DBUG_ENTER("ha_spider::index_end");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- error_num = bulk_access_link_exec_tgt->spider->ha_index_end();
- if (error_num)
- DBUG_RETURN(check_error_mode(error_num));
- DBUG_RETURN(0);
- }
- }
-#endif
active_index = MAX_KEY;
/*
#ifdef INFO_KIND_FORCE_LIMIT_BEGIN
@@ -1591,14 +1437,6 @@ int ha_spider::index_end()
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::pre_index_end()
-{
- DBUG_ENTER("ha_spider::pre_index_end");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_index_end());
-}
-#endif
int ha_spider::index_read_map_internal(
uchar *buf,
@@ -1815,18 +1653,6 @@ int ha_spider::index_read_map_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (
- is_bulk_access_clone &&
- !bulk_access_executing &&
- conn_kind[roop_count] != SPIDER_CONN_KIND_MYSQL
- ) {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -1939,9 +1765,6 @@ int ha_spider::index_read_map_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
if (buf && (error_num = spider_db_fetch(buf, this, table)))
@@ -1955,42 +1778,13 @@ int ha_spider::pre_index_read_map(
enum ha_rkey_function find_flag,
bool use_parallel
) {
-#ifdef HA_CAN_BULK_ACCESS
- int error_num;
-#endif
DBUG_ENTER("ha_spider::pre_index_read_map");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_started)
- {
- error_num = bulk_access_link_current->spider->pre_index_read_map(key,
- keypart_map, find_flag, TRUE);
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
- DBUG_RETURN(error_num);
- } else if (
- bulk_access_executing && !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->pre_index_read_map(key,
- keypart_map, find_flag, TRUE));
- }
-#endif
check_pre_call(use_parallel);
if (use_pre_call)
{
store_error_num =
index_read_map_internal(NULL, key, keypart_map, find_flag);
-#ifdef HA_CAN_BULK_ACCESS
- if (
- !store_error_num &&
- bulk_access_executing &&
- is_bulk_access_clone &&
- !bulk_access_pre_called
- ) {
- bulk_req_exec();
- }
-#endif
DBUG_RETURN(store_error_num);
}
DBUG_RETURN(0);
@@ -2005,59 +1799,6 @@ int ha_spider::index_read_map(
int error_num;
DBUG_ENTER("ha_spider::index_read_map");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (is_bulk_access_clone)
- {
- if (bulk_access_pre_called)
- {
- SPIDER_CONN *conn;
- int roop_count, roop_start, roop_end, tmp_lock_mode, link_ok,
- tmp_error_num;
- tmp_lock_mode = spider_conn_lock_mode(this);
- if (tmp_lock_mode)
- {
- /* "for update" or "lock in share mode" */
- link_ok = spider_conn_link_idx_next(share->link_statuses,
- conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_OK);
- roop_start = spider_conn_link_idx_next(share->link_statuses,
- conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_end = share->link_count;
- } else {
- link_ok = search_link_idx;
- roop_start = search_link_idx;
- roop_end = search_link_idx + 1;
- }
- for (roop_count = roop_start; roop_count < roop_end;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- conn = conns[roop_count];
- if ((tmp_error_num = spider_db_bulk_store_result(this, conn,
- roop_count, (roop_count != link_ok))))
- {
- store_error_num = tmp_error_num;
- } else {
- result_link_idx = link_ok;
- }
- }
- use_pre_call = TRUE;
- bulk_access_pre_called = FALSE;
- } else {
- /* do access normally */
- }
- } else if (bulk_access_link_exec_tgt->called)
- {
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->index_read_map(buf, key,
- keypart_map, find_flag));
- }
- }
-#endif
if (use_pre_call)
{
if (store_error_num)
@@ -2284,15 +2025,6 @@ int ha_spider::index_read_last_map_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -2405,9 +2137,6 @@ int ha_spider::index_read_last_map_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
if (buf && (error_num = spider_db_fetch(buf, this, table)))
@@ -2468,21 +2197,6 @@ int ha_spider::index_next(
my_error(ER_QUERY_INTERRUPTED, MYF(0));
DBUG_RETURN(ER_QUERY_INTERRUPTED);
}
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- error_num = bulk_access_link_exec_tgt->spider->index_next(buf);
- if (error_num)
- DBUG_RETURN(check_error_mode(error_num));
- DBUG_RETURN(0);
- }
- }
-#endif
if (is_clone)
{
DBUG_PRINT("info",("spider set pt_clone_last_searcher to %p",
@@ -2514,21 +2228,6 @@ int ha_spider::index_prev(
my_error(ER_QUERY_INTERRUPTED, MYF(0));
DBUG_RETURN(ER_QUERY_INTERRUPTED);
}
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- error_num = bulk_access_link_exec_tgt->spider->index_prev(buf);
- if (error_num)
- DBUG_RETURN(check_error_mode(error_num));
- DBUG_RETURN(0);
- }
- }
-#endif
if (is_clone)
{
DBUG_PRINT("info",("spider set pt_clone_last_searcher to %p",
@@ -2748,15 +2447,6 @@ int ha_spider::index_first_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -2869,9 +2559,6 @@ int ha_spider::index_first_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
}
@@ -3129,15 +2816,6 @@ int ha_spider::index_last_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -3250,9 +2928,6 @@ int ha_spider::index_last_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
}
@@ -3324,22 +2999,6 @@ int ha_spider::index_next_same(
my_error(ER_QUERY_INTERRUPTED, MYF(0));
DBUG_RETURN(ER_QUERY_INTERRUPTED);
}
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_ASSERT(!bulk_access_started);
- if (bulk_access_executing)
- {
- if (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- error_num = bulk_access_link_exec_tgt->spider->index_next_same(buf, key,
- keylen);
- if (error_num)
- DBUG_RETURN(check_error_mode(error_num));
- DBUG_RETURN(0);
- }
- }
-#endif
if (is_clone)
{
DBUG_PRINT("info",("spider set pt_clone_last_searcher to %p",
@@ -3568,15 +3227,6 @@ int ha_spider::read_range_first_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -3689,9 +3339,6 @@ int ha_spider::read_range_first_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
if (buf && (error_num = spider_db_fetch(buf, this, table)))
@@ -4190,21 +3837,6 @@ int ha_spider::read_multi_range_first_internal(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
-#ifdef HA_MRR_USE_DEFAULT_IMPL
- *range_info = (char *) mrr_cur_range.ptr;
-#else
- *found_range_p = multi_range_curr;
-#endif
- DBUG_RETURN(0);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -4319,9 +3951,6 @@ int ha_spider::read_multi_range_first_internal(
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
if (error_num)
break;
@@ -4980,21 +4609,6 @@ int ha_spider::read_multi_range_first_internal(
}
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
-#ifdef HA_MRR_USE_DEFAULT_IMPL
- *range_info = multi_range_keys[multi_range_hit_point];
-#else
- *found_range_p = &multi_range_ranges[multi_range_hit_point];
-#endif
- DBUG_RETURN(0);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -5152,9 +4766,6 @@ int ha_spider::read_multi_range_first_internal(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
if (error_num)
@@ -5621,21 +5232,6 @@ int ha_spider::read_multi_range_next(
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
-#ifdef HA_MRR_USE_DEFAULT_IMPL
- *range_info = multi_range_keys[multi_range_hit_point];
-#else
- *found_range_p = &multi_range_ranges[multi_range_hit_point];
-#endif
- DBUG_RETURN(0);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -5750,9 +5346,6 @@ int ha_spider::read_multi_range_next(
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
if (error_num)
break;
@@ -6408,21 +6001,6 @@ int ha_spider::read_multi_range_next(
}
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(wide_handler->trx, conn);
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
-#ifdef HA_MRR_USE_DEFAULT_IMPL
- *range_info = multi_range_keys[multi_range_hit_point];
-#else
- *found_range_p = &multi_range_ranges[multi_range_hit_point];
-#endif
- DBUG_RETURN(0);
- } else {
-#endif
conn->need_mon = &need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -6580,9 +6158,6 @@ int ha_spider::read_multi_range_next(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
}
if (error_num)
@@ -6813,15 +6388,6 @@ int ha_spider::rnd_init(
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::pre_rnd_init(
- bool scan
-) {
- DBUG_ENTER("ha_spider::pre_rnd_init");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_rnd_init(scan));
-}
-#endif
int ha_spider::rnd_end()
{
@@ -6845,14 +6411,6 @@ int ha_spider::rnd_end()
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::pre_rnd_end()
-{
- DBUG_ENTER("ha_spider::pre_rnd_end");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_rnd_end());
-}
-#endif
int ha_spider::rnd_next_internal(
uchar *buf
@@ -9257,39 +8815,6 @@ int ha_spider::write_row(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- ulonglong option_backup = 0;
- if (is_bulk_access_clone)
- {
- bulk_access_pre_called = FALSE;
- DBUG_RETURN(spider_db_bulk_bulk_insert(this));
- }
-#if MYSQL_VERSION_ID < 50500
- option_backup = thd->options;
- thd->options &= ~OPTION_BIN_LOG;
-#else
- option_backup = thd->variables.option_bits;
- thd->variables.option_bits &= ~OPTION_BIN_LOG;
-#endif
- error_num = bulk_access_link_exec_tgt->spider->ha_write_row(buf);
-#if MYSQL_VERSION_ID < 50500
- thd->options = option_backup;
-#else
- thd->variables.option_bits = option_backup;
-#endif
- DBUG_RETURN(error_num);
- }
-#endif
if (!dml_inited)
{
if (unlikely((error_num = dml_init())))
@@ -9375,44 +8900,9 @@ int ha_spider::write_row(
if ((error_num = spider_db_bulk_insert(this, table, &copy_info, FALSE)))
DBUG_RETURN(check_error_mode(error_num));
-#ifdef HA_CAN_BULK_ACCESS
- /* bulk access disabled case (like using partitioning) */
- if (bulk_access_executing && is_bulk_access_clone)
- {
- bulk_req_exec();
- DBUG_RETURN(spider_db_bulk_bulk_insert(this));
- }
-#endif
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::pre_write_row(
- uchar *buf
-) {
- int error_num;
- ulonglong option_backup = 0;
- THD *thd = wide_handler->trx->thd;
- DBUG_ENTER("ha_spider::pre_write_row");
- DBUG_PRINT("info",("spider this=%p", this));
-#if MYSQL_VERSION_ID < 50500
- option_backup = thd->options;
- thd->options &= ~OPTION_BIN_LOG;
-#else
- option_backup = thd->variables.option_bits;
- thd->variables.option_bits &= ~OPTION_BIN_LOG;
-#endif
- error_num = bulk_access_link_current->spider->ha_write_row(buf);
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
-#if MYSQL_VERSION_ID < 50500
- thd->options = option_backup;
-#else
- thd->variables.option_bits = option_backup;
-#endif
- DBUG_RETURN(error_num);
-}
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
void ha_spider::direct_update_init(
@@ -9503,29 +8993,6 @@ int ha_spider::update_row(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing && !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- ulonglong option_backup = 0;
-#if MYSQL_VERSION_ID < 50500
- option_backup = thd->options;
- thd->options &= ~OPTION_BIN_LOG;
-#else
- option_backup = thd->variables.option_bits;
- thd->variables.option_bits &= ~OPTION_BIN_LOG;
-#endif
- error_num = bulk_access_link_exec_tgt->spider->ha_update_row(
- old_data, new_data);
-#if MYSQL_VERSION_ID < 50500
- thd->options = option_backup;
-#else
- thd->variables.option_bits = option_backup;
-#endif
- DBUG_RETURN(error_num);
- }
-#endif
#ifndef SPIDER_WITHOUT_HA_STATISTIC_INCREMENT
ha_statistic_increment(&SSV::ha_update_count);
#endif
@@ -9624,32 +9091,6 @@ int ha_spider::direct_update_rows_init(
THD *thd = wide_handler->trx->thd;
DBUG_ENTER("ha_spider::direct_update_rows_init");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- DBUG_PRINT("info",("spider return pre_direct_init_result %d",
- pre_direct_init_result));
- DBUG_RETURN(pre_direct_init_result);
- }
-#ifdef SPIDER_MDEV_16246
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_update_rows_init(
- update_fields, mode, ranges, range_count, sorted, new_data));
-#else
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_update_rows_init(
- mode, ranges, range_count, sorted, new_data));
-#endif
- }
-#endif
if (!dml_inited)
{
if (unlikely((error_num = dml_init())))
@@ -9775,31 +9216,6 @@ int ha_spider::direct_update_rows_init()
}
}
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- DBUG_PRINT("info",("spider return pre_direct_init_result %d",
- pre_direct_init_result));
- DBUG_RETURN(pre_direct_init_result);
- }
-#ifdef SPIDER_MDEV_16246
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->
- direct_update_rows_init(update_fields));
-#else
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_update_rows_init());
-#endif
- }
-#endif
if (!dml_inited)
{
if (unlikely(dml_init()))
@@ -9870,112 +9286,6 @@ int ha_spider::direct_update_rows_init()
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
-#ifdef SPIDER_MDEV_16246
-int ha_spider::pre_direct_update_rows_init(
- List<Item> *update_fields,
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data
-)
-#else
-int ha_spider::pre_direct_update_rows_init(
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data
-)
-#endif
-{
- int error_num;
- DBUG_ENTER("ha_spider::pre_direct_update_rows_init");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_started)
- {
-#ifdef SPIDER_MDEV_16246
- error_num = bulk_access_link_current->spider->
- pre_direct_update_rows_init(
- update_fields, mode, ranges, range_count, sorted, new_data);
-#else
- error_num = bulk_access_link_current->spider->
- pre_direct_update_rows_init(
- mode, ranges, range_count, sorted, new_data);
-#endif
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
- DBUG_RETURN(error_num);
- }
- if (!dml_inited)
- {
- if (unlikely((error_num = dml_init())))
- {
- DBUG_RETURN(error_num);
- }
- }
-#ifdef SPIDER_MDEV_16246
- pre_direct_init_result = direct_update_rows_init(
- update_fields, mode, ranges, range_count, sorted, new_data);
-#else
- pre_direct_init_result = direct_update_rows_init(
- mode, ranges, range_count, sorted, new_data);
-#endif
- DBUG_RETURN(pre_direct_init_result);
-}
-#else
-#ifdef SPIDER_MDEV_16246
-/**
- Do initialization for performing parallel direct update
- for a handlersocket update request.
-
- @param update fields Pointer to the list of fields to update.
-
- @return >0 Error.
- 0 Success.
-*/
-
-int ha_spider::pre_direct_update_rows_init(
- List<Item> *update_fields
-)
-#else
-int ha_spider::pre_direct_update_rows_init()
-#endif
-{
- int error_num;
- DBUG_ENTER("ha_spider::pre_direct_update_rows_init");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_started)
- {
-#ifdef SPIDER_MDEV_16246
- error_num = bulk_access_link_current->spider->
- pre_direct_update_rows_init(update_fields);
-#else
- error_num = bulk_access_link_current->spider->
- pre_direct_update_rows_init();
-#endif
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
- DBUG_RETURN(error_num);
- }
- if (!dml_inited)
- {
- if (unlikely((error_num = dml_init())))
- {
- DBUG_RETURN(error_num);
- }
- }
-#ifdef SPIDER_MDEV_16246
- pre_direct_init_result = direct_update_rows_init(update_fields);
-#else
- pre_direct_init_result = direct_update_rows_init();
-#endif
- DBUG_RETURN(pre_direct_init_result);
-}
-#endif
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
int ha_spider::direct_update_rows(
@@ -9997,26 +9307,6 @@ int ha_spider::direct_update_rows(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- bulk_access_pre_called = FALSE;
- DBUG_RETURN(spider_db_bulk_direct_update(this, update_rows, found_rows));
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->ha_direct_update_rows(
- ranges, range_count, sorted, new_data, update_rows, found_rows));
- }
-#endif
if (
(active_index != MAX_KEY && (error_num = index_handler_init())) ||
(active_index == MAX_KEY && (error_num = rnd_handler_init())) ||
@@ -10025,13 +9315,6 @@ int ha_spider::direct_update_rows(
)
DBUG_RETURN(check_error_mode(error_num));
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_executing && is_bulk_access_clone)
- {
- bulk_req_exec();
- DBUG_RETURN(spider_db_bulk_direct_update(this, update_rows, found_rows));
- }
-#endif
DBUG_RETURN(0);
}
#else
@@ -10050,26 +9333,6 @@ int ha_spider::direct_update_rows(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- bulk_access_pre_called = FALSE;
- DBUG_RETURN(spider_db_bulk_direct_update(this, update_rows, found_rows));
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->ha_direct_update_rows(
- update_rows, found_rows));
- }
-#endif
if (
(active_index != MAX_KEY && (error_num = index_handler_init())) ||
(active_index == MAX_KEY && (error_num = rnd_handler_init())) ||
@@ -10077,44 +9340,10 @@ int ha_spider::direct_update_rows(
)
DBUG_RETURN(check_error_mode(error_num));
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_executing && is_bulk_access_clone)
- {
- bulk_req_exec();
- DBUG_RETURN(spider_db_bulk_direct_update(this, update_rows, found_rows));
- }
-#endif
DBUG_RETURN(0);
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
-int ha_spider::pre_direct_update_rows(
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data,
- ha_rows *update_rows,
- ha_rows *found_rows
-) {
- DBUG_ENTER("ha_spider::pre_direct_update_rows");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_direct_update_rows(ranges,
- range_count, sorted, new_data, update_rows, found_rows));
-}
-#else
-int ha_spider::pre_direct_update_rows()
-{
- uint update_rows;
- uint found_rows;
- DBUG_ENTER("ha_spider::pre_direct_update_rows");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_direct_update_rows(
- &update_rows, &found_rows));
-}
-#endif
-#endif
#endif
bool ha_spider::start_bulk_delete(
@@ -10149,28 +9378,6 @@ int ha_spider::delete_row(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing && !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) {
- ulonglong option_backup = 0;
-#if MYSQL_VERSION_ID < 50500
- option_backup = thd->options;
- thd->options &= ~OPTION_BIN_LOG;
-#else
- option_backup = thd->variables.option_bits;
- thd->variables.option_bits &= ~OPTION_BIN_LOG;
-#endif
- error_num = bulk_access_link_exec_tgt->spider->ha_delete_row(buf);
-#if MYSQL_VERSION_ID < 50500
- thd->options = option_backup;
-#else
- thd->variables.option_bits = option_backup;
-#endif
- DBUG_RETURN(error_num);
- }
-#endif
#ifndef SPIDER_WITHOUT_HA_STATISTIC_INCREMENT
ha_statistic_increment(&SSV::ha_delete_count);
#endif
@@ -10218,25 +9425,6 @@ int ha_spider::direct_delete_rows_init(
THD *thd = wide_handler->trx->thd;
DBUG_ENTER("ha_spider::direct_delete_rows_init");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- DBUG_RETURN(pre_direct_init_result);
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_delete_rows_init(
- mode, ranges, range_count, sorted));
- }
-#endif
if (!dml_inited)
{
if (unlikely((error_num = dml_init())))
@@ -10315,24 +9503,6 @@ int ha_spider::direct_delete_rows_init()
THD *thd = wide_handler->trx->thd;
DBUG_ENTER("ha_spider::direct_delete_rows_init");
DBUG_PRINT("info",("spider this=%p", this));
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- DBUG_RETURN(pre_direct_init_result);
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->direct_delete_rows_init());
- }
-#endif
if (!dml_inited)
{
if (unlikely(dml_init()))
@@ -10383,63 +9553,6 @@ int ha_spider::direct_delete_rows_init()
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
-int ha_spider::pre_direct_delete_rows_init(
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted
-) {
- int error_num;
- DBUG_ENTER("ha_spider::pre_direct_delete_rows_init");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_started)
- {
- error_num = bulk_access_link_current->spider->
- pre_direct_delete_rows_init(
- mode, ranges, range_count, sorted);
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
- DBUG_RETURN(error_num);
- }
- if (!dml_inited)
- {
- if (unlikely((error_num = dml_init())))
- {
- DBUG_RETURN(error_num);
- }
- }
- pre_direct_init_result = direct_delete_rows_init(
- mode, ranges, range_count, sorted);
- DBUG_RETURN(pre_direct_init_result);
-}
-#else
-int ha_spider::pre_direct_delete_rows_init()
-{
- int error_num;
- DBUG_ENTER("ha_spider::pre_direct_delete_rows_init");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_started)
- {
- error_num = bulk_access_link_current->spider->
- pre_direct_delete_rows_init();
- bulk_access_link_current->spider->bulk_access_pre_called = TRUE;
- bulk_access_link_current->called = TRUE;
- DBUG_RETURN(error_num);
- }
- if (!dml_inited)
- {
- if (unlikely((error_num = dml_init())))
- {
- DBUG_RETURN(error_num);
- }
- }
- pre_direct_init_result = direct_delete_rows_init();
- DBUG_RETURN(pre_direct_init_result);
-}
-#endif
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
int ha_spider::direct_delete_rows(
@@ -10459,26 +9572,6 @@ int ha_spider::direct_delete_rows(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- bulk_access_pre_called = FALSE;
- DBUG_RETURN(spider_db_bulk_direct_update(this, delete_rows));
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->ha_direct_delete_rows(
- ranges, range_count, sorted, delete_rows));
- }
-#endif
if (
(active_index != MAX_KEY && (error_num = index_handler_init())) ||
(active_index == MAX_KEY && (error_num = rnd_handler_init())) ||
@@ -10487,13 +9580,6 @@ int ha_spider::direct_delete_rows(
)
DBUG_RETURN(check_error_mode(error_num));
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_executing && is_bulk_access_clone)
- {
- bulk_req_exec();
- DBUG_RETURN(spider_db_bulk_direct_update(this, delete_rows));
- }
-#endif
DBUG_RETURN(0);
}
#else
@@ -10511,26 +9597,6 @@ int ha_spider::direct_delete_rows(
table_share->db.str, table_share->table_name.str);
DBUG_RETURN(ER_SPIDER_READ_ONLY_NUM);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (
- bulk_access_executing &&
- (
- (
- !is_bulk_access_clone &&
- bulk_access_link_exec_tgt->called
- ) ||
- bulk_access_pre_called
- )
- ) {
- if (is_bulk_access_clone)
- {
- bulk_access_pre_called = FALSE;
- DBUG_RETURN(spider_db_bulk_direct_update(this, delete_rows));
- }
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->ha_direct_delete_rows(
- delete_rows));
- }
-#endif
if (
(active_index != MAX_KEY && (error_num = index_handler_init())) ||
(active_index == MAX_KEY && (error_num = rnd_handler_init())) ||
@@ -10538,41 +9604,10 @@ int ha_spider::direct_delete_rows(
)
DBUG_RETURN(check_error_mode(error_num));
-#ifdef HA_CAN_BULK_ACCESS
- if (bulk_access_executing && is_bulk_access_clone)
- {
- bulk_req_exec();
- DBUG_RETURN(spider_db_bulk_direct_update(this, delete_rows));
- }
-#endif
DBUG_RETURN(0);
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
-int ha_spider::pre_direct_delete_rows(
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- ha_rows *delete_rows
-) {
- DBUG_ENTER("ha_spider::pre_direct_delete_rows");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_direct_delete_rows(
- ranges, range_count, sorted, delete_rows));
-}
-#else
-int ha_spider::pre_direct_delete_rows()
-{
- uint delete_rows;
- DBUG_ENTER("ha_spider::pre_direct_delete_rows");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_RETURN(bulk_access_link_current->spider->ha_direct_delete_rows(
- &delete_rows));
-}
-#endif
-#endif
#endif
int ha_spider::delete_all_rows()
@@ -10658,59 +9693,6 @@ int ha_spider::truncate()
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-void ha_spider::bulk_req_exec()
-{
- int need_mon;
- SPIDER_CONN *conn = wide_handler->trx->bulk_access_conn_first;
- DBUG_ENTER("ha_spider::bulk_req_exec");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_PRINT("info",("spider trx=%p", wide_handler->trx));
- DBUG_PRINT("info",("spider first_conn=%p", conn));
- while (conn)
- {
- DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider conn->bulk_access_requests=%u",
- conn->bulk_access_requests));
- if (conn->bulk_access_requests)
- {
- spider_bg_conn_wait(conn);
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &need_mon;
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- /* currently only used for HS */
- conn->bulk_access_error_num = 0;
- if (spider_db_query(
- conn,
- NULL,
- 0,
- -1,
- &need_mon)
- ) {
- conn->bulk_access_error_num = spider_db_errorno(conn);
- }
-/*
- conn->bulk_access_sended += conn->bulk_access_requests;
-*/
- conn->bulk_access_requests = 0;
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- }
- conn = conn->bulk_access_next;
- }
- wide_handler->trx->bulk_access_conn_first = NULL;
- DBUG_VOID_RETURN;
-}
-#endif
double ha_spider::scan_time()
{
@@ -11543,12 +10525,6 @@ Field *ha_spider::field_exchange(
Field *field
) {
DBUG_ENTER("ha_spider::field_exchange");
-#ifdef HA_CAN_BULK_ACCESS
- if (is_bulk_access_clone)
- {
- DBUG_RETURN(pt_clone_source_handler->field_exchange(field));
- }
-#endif
DBUG_PRINT("info",("spider in field=%p", field));
DBUG_PRINT("info",("spider in field->table=%p", field->table));
DBUG_PRINT("info",("spider table=%p", table));
@@ -11626,30 +10602,6 @@ int ha_spider::info_push(
wide_handler->stage = SPD_HND_STAGE_INFO_PUSH;
wide_handler->stage_executor = this;
#endif
-#ifdef HA_CAN_BULK_ACCESS
- if (
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
-#endif
- info_type != INFO_KIND_BULK_ACCESS_BEGIN &&
- info_type != INFO_KIND_BULK_ACCESS_CURRENT &&
- info_type != INFO_KIND_BULK_ACCESS_END
- ) {
- if (!is_bulk_access_clone)
- {
- if (
- bulk_access_executing &&
- bulk_access_link_exec_tgt->called
- ) {
- DBUG_RETURN(bulk_access_link_exec_tgt->spider->info_push(info_type,
- info));
- } else if (bulk_access_started)
- {
- DBUG_RETURN(bulk_access_link_current->spider->info_push(info_type,
- info));
- }
- }
- }
-#endif
#if defined(HANDLER_HAS_DIRECT_UPDATE_ROWS) || defined(HA_CAN_BULK_ACCESS)
switch (info_type)
@@ -11683,65 +10635,6 @@ int ha_spider::info_push(
break;
#endif
#endif
-#ifdef HA_CAN_BULK_ACCESS
- case INFO_KIND_BULK_ACCESS_BEGIN:
- DBUG_PRINT("info",("spider INFO_KIND_BULK_ACCESS_BEGIN"));
- if (partition_handler && partition_handler->handlers)
- {
- size_t roop_count;
- ha_spider **handlers = partition_handler->handlers;
- for (roop_count = 0; roop_count < partition_handler->no_parts;
- ++roop_count)
- {
- if ((error_num = handlers[roop_count]->bulk_access_begin(info)))
- {
- DBUG_RETURN(error_num);
- }
- }
- } else {
- if ((error_num = bulk_access_begin(info)))
- {
- DBUG_RETURN(error_num);
- }
- }
- break;
- case INFO_KIND_BULK_ACCESS_CURRENT:
- DBUG_PRINT("info",("spider INFO_KIND_BULK_ACCESS_CURRENT"));
- if (partition_handler && partition_handler->handlers)
- {
- size_t roop_count;
- ha_spider **handlers = partition_handler->handlers;
- for (roop_count = 0; roop_count < partition_handler->no_parts;
- ++roop_count)
- {
- if ((error_num = handlers[roop_count]->bulk_access_current(info)))
- {
- DBUG_RETURN(error_num);
- }
- }
- } else {
- if ((error_num = bulk_access_current(info)))
- {
- DBUG_RETURN(error_num);
- }
- }
- break;
- case INFO_KIND_BULK_ACCESS_END:
- DBUG_PRINT("info",("spider INFO_KIND_BULK_ACCESS_END"));
- if (partition_handler && partition_handler->handlers)
- {
- size_t roop_count;
- ha_spider **handlers = partition_handler->handlers;
- for (roop_count = 0; roop_count < partition_handler->no_parts;
- ++roop_count)
- {
- handlers[roop_count]->bulk_access_end();
- }
- } else {
- bulk_access_end();
- }
- break;
-#endif
default:
break;
}
@@ -12904,147 +11797,6 @@ void ha_spider::check_insert_dup_update_pushdown()
}
#endif
-#ifdef HA_CAN_BULK_ACCESS
-SPIDER_BULK_ACCESS_LINK *ha_spider::create_bulk_access_link()
-{
- uchar *ref;
- ha_spider *spider;
- SPIDER_BULK_ACCESS_LINK *bulk_access_link;
- DBUG_ENTER("ha_spider::create_bulk_access_link");
- DBUG_PRINT("info",("spider this=%p", this));
-/*
- if (!init_ha_mem_root)
- {
- SPD_INIT_ALLOC_ROOT(&ha_mem_root, sizeof(ha_spider) * 16,
- sizeof(ha_spider) * 16, MYF(MY_WME));
- init_ha_mem_root = TRUE;
- }
-*/
- if (!(bulk_access_link = (SPIDER_BULK_ACCESS_LINK *)
- spider_bulk_malloc(spider_current_trx, 168, MYF(MY_WME),
- &bulk_access_link, (uint) (sizeof(SPIDER_BULK_ACCESS_LINK)),
- &ref, (uint) (ALIGN_SIZE(ref_length) * 2),
- NullS))
- ) {
- goto error_bulk_malloc;
- }
- SPD_INIT_ALLOC_ROOT(&bulk_access_link->mem_root, sizeof(ha_spider), 0,
- MYF(MY_WME));
-/*
- if (!(spider = new ha_spider(spider_hton_ptr, table_share)))
- if (!(spider = (ha_spider *) spider_create_handler(
- spider_hton_ptr, table_share, &ha_mem_root)))
-*/
- if (!(spider = (ha_spider *) spider_create_handler(
- spider_hton_ptr, table_share, &bulk_access_link->mem_root)))
- {
- goto error_new_spider;
- }
- DBUG_PRINT("info",("spider spider=%p", spider));
- bulk_access_link->spider = spider;
- spider->ref = ref;
- bulk_access_link->next = NULL;
- spider->is_clone = TRUE;
- spider->is_bulk_access_clone = TRUE;
- spider->pt_clone_source_handler = this;
- if (spider->ha_open(table, share->table_name, table->db_stat,
- HA_OPEN_IGNORE_IF_LOCKED))
- {
- goto error_ha_open;
- }
- DBUG_RETURN(bulk_access_link);
-
-error_ha_open:
- delete spider;
-error_new_spider:
- free_root(&bulk_access_link->mem_root, MYF(0));
- spider_free(spider_current_trx, bulk_access_link, MYF(0));
-error_bulk_malloc:
- DBUG_RETURN(NULL);
-}
-
-void ha_spider::delete_bulk_access_link(
- SPIDER_BULK_ACCESS_LINK *bulk_access_link
-) {
- ha_spider *spider = bulk_access_link->spider;
- DBUG_ENTER("ha_spider::delete_bulk_access_link");
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_PRINT("info",("spider spider=%p", spider));
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- spider->dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
- &spider->dbton_handler));
- spider->close();
- delete spider;
- free_root(&bulk_access_link->mem_root, MYF(0));
- spider_free(spider_current_trx, bulk_access_link, MYF(0));
- DBUG_VOID_RETURN;
-}
-
-int ha_spider::sync_from_clone_source(
- ha_spider *spider
-) {
- int error_num;
- DBUG_ENTER("ha_spider::sync_from_clone_source");
- sync_from_clone_source_base(spider);
- if (!synced_from_clone_source)
- {
- DBUG_PRINT("info",("spider synced from clone source all"));
- wide_handler->trx = spider->wide_handler->trx;
- sql_command = spider->sql_command;
- wide_handler->external_lock_type =
- spider->wide_handler->external_lock_type;
- selupd_lock_mode = spider->selupd_lock_mode;
- update_request = spider->update_request;
- lock_mode = spider->lock_mode;
- high_priority = spider->high_priority;
- insert_delayed = spider->insert_delayed;
- low_priority = spider->low_priority;
- memcpy(conns, spider->conns,
- sizeof(SPIDER_CONN *) * share->link_count);
- spider_thread_id = spider->spider_thread_id;
- trx_conn_adjustment = spider->trx_conn_adjustment;
- search_link_idx = spider->search_link_idx;
- external_lock_cnt = spider->external_lock_cnt;
- uint roop_count, dbton_id;
- spider_db_handler *dbton_hdl, *dbton_hdl2;
- for (roop_count = 0; roop_count < share->use_dbton_count; roop_count++)
- {
- dbton_id = share->use_dbton_ids[roop_count];
- dbton_hdl = dbton_handler[dbton_id];
- dbton_hdl2 = spider->dbton_handler[dbton_id];
- dbton_hdl->sync_from_clone_source(dbton_hdl2);
- }
- synced_from_clone_source = TRUE;
- } else if (external_lock_cnt != spider->external_lock_cnt)
- {
- DBUG_PRINT("info",("spider synced from clone source"));
- sql_command = spider->sql_command;
- wide_handler->external_lock_type =
- spider->wide_handler->external_lock_type;
- selupd_lock_mode = spider->selupd_lock_mode;
- update_request = spider->update_request;
- lock_mode = spider->lock_mode;
- high_priority = spider->high_priority;
- insert_delayed = spider->insert_delayed;
- low_priority = spider->low_priority;
-
- if ((error_num = spider_check_trx_and_get_conn(
- spider->wide_handler->trx->thd,
- this, TRUE)))
- {
- DBUG_RETURN(error_num);
- }
- external_lock_cnt = spider->external_lock_cnt;
- }
-
- DBUG_PRINT("info",("spider bulk_access_link->spider->dbton_handler=%p",
- dbton_handler));
- DBUG_PRINT("info",("spider ptr bulk_access_link->spider->dbton_handler=%p",
- &dbton_handler));
- DBUG_RETURN(0);
-}
-#endif
void ha_spider::sync_from_clone_source_base(
ha_spider *spider
@@ -15203,92 +13955,3 @@ int ha_spider::dml_init()
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int ha_spider::bulk_access_begin(
- void *info
-) {
- DBUG_ENTER("ha_spider::bulk_access_begin");
- DBUG_PRINT("info",("spider this=%p", this));
- if (bulk_access_started)
- {
- if (!bulk_access_link_current->next)
- {
- if (!(bulk_access_link_current->next = create_bulk_access_link()))
- {
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- }
- bulk_access_link_current->next->sequence_num =
- bulk_access_link_current->sequence_num + 1;
- }
- bulk_access_link_current = bulk_access_link_current->next;
- } else {
- if (!bulk_access_link_first)
- {
- if (!(bulk_access_link_first = create_bulk_access_link()))
- {
- DBUG_RETURN(HA_ERR_OUT_OF_MEM);
- }
- bulk_access_link_first->sequence_num = 0;
- }
- bulk_access_link_current = bulk_access_link_first;
- bulk_access_started = TRUE;
- bulk_access_executing = FALSE;
- }
- bulk_access_link_current->spider->
- check_access_kind(wide_handler->trx->thd);
- if (
- (error_num = bulk_access_link_current->spider->
- sync_from_clone_source(this)) ||
- (error_num = bulk_access_link_current->spider->
- check_access_kind_for_connection(wide_handler->trx->thd,
- (lock_type >= TL_WRITE_ALLOW_WRITE)))
- ) {
- DBUG_RETURN(error_num);
- }
- bulk_access_link_current->spider->bulk_access_executing = FALSE;
- bulk_access_link_current->spider->bulk_access_pre_called = FALSE;
- bulk_access_link_current->used = TRUE;
- bulk_access_link_current->called = FALSE;
- *((void **) info) = bulk_access_link_current;
- DBUG_RETURN(0);
-}
-
-int ha_spider::bulk_access_current(
- void *info
-) {
- DBUG_ENTER("ha_spider::bulk_access_current");
- DBUG_PRINT("info",("spider this=%p", this));
- bulk_access_executing = TRUE;
- bulk_access_link_exec_tgt = (SPIDER_BULK_ACCESS_LINK *) info;
- if (bulk_access_link_exec_tgt->spider->pt_clone_source_handler != this)
- {
- DBUG_PRINT("info",("spider this=%p", this));
- DBUG_PRINT("info",("spider pt_clone_source_handler=%p",
- bulk_access_link_exec_tgt->spider->pt_clone_source_handler));
- /* partitioned */
- uint sequence_num = bulk_access_link_exec_tgt->sequence_num;
- for (
- bulk_access_link_exec_tgt = bulk_access_link_first;
- bulk_access_link_exec_tgt;
- bulk_access_link_exec_tgt = bulk_access_link_exec_tgt->next
- ) {
- if (bulk_access_link_exec_tgt->sequence_num >= sequence_num)
- {
- DBUG_ASSERT(
- bulk_access_link_exec_tgt->sequence_num == sequence_num);
- break;
- }
- }
- }
- bulk_access_link_exec_tgt->spider->bulk_access_executing = TRUE;
- DBUG_RETURN(0);
-}
-
-void ha_spider::bulk_access_end()
-{
- DBUG_ENTER("ha_spider::bulk_access_end");
- DBUG_PRINT("info",("spider this=%p", this));
- bulk_access_started = FALSE;
- DBUG_VOID_RETURN;
-}
-#endif
diff --git a/storage/spider/ha_spider.h b/storage/spider/ha_spider.h
index 8ef6f0aeca9..66675a1a724 100644
--- a/storage/spider/ha_spider.h
+++ b/storage/spider/ha_spider.h
@@ -85,21 +85,6 @@ public:
bool wide_handler_owner = FALSE;
SPIDER_WIDE_HANDLER *wide_handler = NULL;
-#ifdef HA_CAN_BULK_ACCESS
- int pre_direct_init_result;
- bool is_bulk_access_clone;
- bool synced_from_clone_source;
- bool bulk_access_started;
- bool bulk_access_executing;
- bool bulk_access_pre_called;
- SPIDER_BULK_ACCESS_LINK *bulk_access_link_first;
- SPIDER_BULK_ACCESS_LINK *bulk_access_link_current;
- SPIDER_BULK_ACCESS_LINK *bulk_access_link_exec_tgt;
-/*
- bool init_ha_mem_root;
- MEM_ROOT ha_mem_root;
-*/
-#endif
bool is_clone;
ha_spider *pt_clone_source_handler;
ha_spider *pt_clone_last_searcher;
@@ -222,12 +207,6 @@ public:
void check_access_kind(
THD *thd
);
-#ifdef HA_CAN_BULK_ACCESS
- int additional_lock(
- THD *thd,
- enum thr_lock_type lock_type
- );
-#endif
THR_LOCK_DATA **store_lock(
THD *thd,
THR_LOCK_DATA **to,
@@ -249,16 +228,7 @@ public:
uint idx,
bool sorted
);
-#ifdef HA_CAN_BULK_ACCESS
- int pre_index_init(
- uint idx,
- bool sorted
- );
-#endif
int index_end();
-#ifdef HA_CAN_BULK_ACCESS
- int pre_index_end();
-#endif
int index_read_map(
uchar *buf,
const uchar *key,
@@ -346,15 +316,7 @@ public:
int rnd_init(
bool scan
);
-#ifdef HA_CAN_BULK_ACCESS
- int pre_rnd_init(
- bool scan
- );
-#endif
int rnd_end();
-#ifdef HA_CAN_BULK_ACCESS
- int pre_rnd_end();
-#endif
int rnd_next(
uchar *buf
);
@@ -480,11 +442,6 @@ public:
int write_row(
const uchar *buf
);
-#ifdef HA_CAN_BULK_ACCESS
- int pre_write_row(
- uchar *buf
- );
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
void direct_update_init(
THD *thd,
@@ -560,45 +517,6 @@ public:
int direct_update_rows_init();
#endif
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
-#ifdef SPIDER_MDEV_16246
- inline int pre_direct_update_rows_init(
- List<Item> *update_fields
- ) {
- return pre_direct_update_rows_init(update_fields, 2, NULL, 0, FALSE, NULL);
- }
- int pre_direct_update_rows_init(
- List<Item> *update_fields,
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data
- );
-#else
- inline int pre_direct_update_rows_init()
- {
- return pre_direct_update_rows_init(2, NULL, 0, FALSE, NULL);
- }
- int pre_direct_update_rows_init(
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data
- );
-#endif
-#else
-#ifdef SPIDER_MDEV_16246
- int pre_direct_update_rows_init(
- List<Item> *update_fields
- );
-#else
- int pre_direct_update_rows_init();
-#endif
-#endif
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int direct_update_rows(ha_rows *update_rows, ha_rows *found_rows)
{
@@ -618,28 +536,6 @@ public:
ha_rows *found_row
);
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
- inline int pre_direct_update_rows()
- {
- ha_rows update_rows;
- ha_rows found_rows;
-
- return pre_direct_update_rows(NULL, 0, FALSE, NULL, &update_rows,
- &found_rows);
- }
- int pre_direct_update_rows(
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- uchar *new_data,
- ha_rows *update_rows,
- ha_rows *found_row
- );
-#else
- int pre_direct_update_rows();
-#endif
-#endif
#endif
bool start_bulk_delete();
int end_bulk_delete();
@@ -666,22 +562,6 @@ public:
#else
int direct_delete_rows_init();
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
- inline int pre_direct_delete_rows_init()
- {
- return pre_direct_delete_rows_init(2, NULL, 0, FALSE);
- }
- int pre_direct_delete_rows_init(
- uint mode,
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted
- );
-#else
- int pre_direct_delete_rows_init();
-#endif
-#endif
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
inline int direct_delete_rows(ha_rows *delete_rows)
{
@@ -698,24 +578,6 @@ public:
ha_rows *delete_rows
);
#endif
-#ifdef HA_CAN_BULK_ACCESS
-#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS_WITH_HS
- inline int pre_direct_delete_rows()
- {
- ha_rows delete_rows;
-
- return pre_direct_delete_rows(NULL, 0, FALSE, &delete_rows);
- }
- int pre_direct_delete_rows(
- KEY_MULTI_RANGE *ranges,
- uint range_count,
- bool sorted,
- ha_rows *delete_rows
- );
-#else
- int pre_direct_delete_rows();
-#endif
-#endif
#endif
int delete_all_rows();
int truncate();
@@ -725,9 +587,6 @@ public:
uint ranges,
ha_rows rows
);
-#ifdef HA_CAN_BULK_ACCESS
- void bulk_req_exec();
-#endif
const key_map *keys_to_use_for_scanning();
ha_rows estimate_rows_upper_bound();
void print_error(
@@ -889,15 +748,6 @@ public:
#ifdef HANDLER_HAS_DIRECT_UPDATE_ROWS
void check_insert_dup_update_pushdown();
#endif
-#ifdef HA_CAN_BULK_ACCESS
- SPIDER_BULK_ACCESS_LINK *create_bulk_access_link();
- void delete_bulk_access_link(
- SPIDER_BULK_ACCESS_LINK *bulk_access_link
- );
- int sync_from_clone_source(
- ha_spider *spider
- );
-#endif
void sync_from_clone_source_base(
ha_spider *spider
);
@@ -1123,13 +973,4 @@ public:
int append_lock_tables_list();
int lock_tables();
int dml_init();
-#ifdef HA_CAN_BULK_ACCESS
- int bulk_access_begin(
- void *info
- );
- int bulk_access_current(
- void *info
- );
- void bulk_access_end();
-#endif
};
diff --git a/storage/spider/spd_conn.cc b/storage/spider/spd_conn.cc
index b839eaacb71..a2d7a94eb93 100644
--- a/storage/spider/spd_conn.cc
+++ b/storage/spider/spd_conn.cc
@@ -2704,13 +2704,6 @@ void *spider_bg_conn_action(
}
sql_type &= ~SPIDER_SQL_TYPE_TMP_SQL;
DBUG_PRINT("info",("spider sql_type=%lu", sql_type));
-#ifdef HA_CAN_BULK_ACCESS
- if (spider->is_bulk_access_clone)
- {
- spider->connection_ids[conn->link_idx] = conn->connection_id;
- spider_trx_add_bulk_access_conn(spider->trx, conn);
- }
-#endif
if (!result_list->bgs_error)
{
conn->need_mon = &spider->need_mons[conn->link_idx];
@@ -2718,10 +2711,6 @@ void *spider_bg_conn_action(
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = TRUE;
conn->mta_conn_mutex_unlock_later = TRUE;
-#ifdef HA_CAN_BULK_ACCESS
- if (!spider->is_bulk_access_clone)
- {
-#endif
if (!(result_list->bgs_error =
spider_db_set_names(spider, conn, conn->link_idx)))
{
@@ -2790,9 +2779,6 @@ void *spider_bg_conn_action(
strmov(result_list->bgs_error_msg,
spider_stmt_da_message(thd));
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
diff --git a/storage/spider/spd_db_conn.cc b/storage/spider/spd_db_conn.cc
index e3866da9454..a2f2df74237 100644
--- a/storage/spider/spd_db_conn.cc
+++ b/storage/spider/spd_db_conn.cc
@@ -4504,42 +4504,6 @@ void spider_db_discard_multiple_result(
DBUG_VOID_RETURN;
}
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_store_result(
- ha_spider *spider,
- SPIDER_CONN *conn,
- int link_idx,
- bool discard_result
-) {
- int error_num, tmp_error_num;
- DBUG_ENTER("spider_db_bulk_store_result");
- DBUG_PRINT("info",("spider spider=%p", spider));
- DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider link_idx=%d", link_idx));
- if (conn->conn_kind == SPIDER_CONN_KIND_MYSQL)
- {
- /* already stored */
- DBUG_RETURN(0);
- }
- error_num = spider_db_bulk_open_handler(spider, conn, link_idx);
- if (!discard_result)
- {
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_unlock_later = TRUE;
- if ((tmp_error_num = spider_db_store_result(spider, link_idx,
- spider->get_table())))
- {
- error_num = tmp_error_num;
- }
- conn->mta_conn_mutex_unlock_later = FALSE;
- } else {
- if (spider->connection_ids[link_idx] == conn->connection_id)
- spider_db_discard_result(spider, link_idx, conn);
- }
- DBUG_RETURN(error_num);
-}
-#endif
int spider_db_fetch(
uchar *buf,
@@ -6182,10 +6146,6 @@ int spider_db_bulk_insert(
spider->set_insert_to_pos_sql(SPIDER_SQL_TYPE_INSERT_SQL);
DBUG_RETURN(error_num);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (!spider->is_bulk_access_clone)
- {
-#endif
bool insert_info = FALSE;
for (
roop_count2 = spider_conn_link_idx_next(share->link_statuses,
@@ -6387,9 +6347,6 @@ int spider_db_bulk_insert(
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
spider->store_last_insert_id = 0;
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
}
if (
(bulk_end || !spider->bulk_insert) &&
@@ -6399,95 +6356,6 @@ int spider_db_bulk_insert(
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_bulk_insert(
- ha_spider *spider
-) {
- int error_num = 0, first_insert_link_idx = -1, tmp_error_num;
- int roop_count2;
- SPIDER_SHARE *share = spider->share;
- SPIDER_CONN *conn, *first_insert_conn = NULL;
- TABLE *table = spider->get_table();
- THD *thd = spider->wide_handler->trx->thd;
- DBUG_ENTER("spider_db_bulk_bulk_insert");
- for (
- roop_count2 = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count2 < (int) share->link_count;
- roop_count2 = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count2, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- conn = spider->conns[roop_count2];
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- if ((tmp_error_num = spider_db_bulk_open_handler(spider, conn,
- roop_count2)))
- {
- error_num = tmp_error_num;
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- if (first_insert_link_idx == -1)
- {
- first_insert_link_idx = roop_count2;
- first_insert_conn = conn;
- }
- }
-
- conn = first_insert_conn;
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- conn->need_mon = &spider->need_mons[first_insert_link_idx];
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- if (table->next_number_field &&
- (
- !table->auto_increment_field_not_null ||
- (
- !table->next_number_field->val_int() &&
- !(thd->variables.sql_mode & MODE_NO_AUTO_VALUE_ON_ZERO)
- )
- )
- ) {
- ulonglong last_insert_id;
- if (spider->store_last_insert_id)
- last_insert_id = spider->store_last_insert_id;
- else
- last_insert_id = conn->db_conn->last_insert_id();
- table->next_number_field->set_notnull();
- if (
- (tmp_error_num = spider_db_update_auto_increment(spider,
- first_insert_link_idx)) ||
- (tmp_error_num = table->next_number_field->store(
- last_insert_id, TRUE))
- ) {
- error_num = tmp_error_num;
- }
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- spider->store_last_insert_id = 0;
- DBUG_RETURN(error_num);
-}
-#endif
int spider_db_update_auto_increment(
ha_spider *spider,
@@ -7144,13 +7012,6 @@ int spider_db_direct_update(
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (spider->is_bulk_access_clone)
- {
- spider->connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
- } else {
-#endif
conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7242,9 +7103,6 @@ int spider_db_direct_update(
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE;
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
@@ -7372,13 +7230,6 @@ int spider_db_direct_update(
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (spider->is_bulk_access_clone)
- {
- spider->connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
- } else {
-#endif
conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7471,9 +7322,6 @@ int spider_db_direct_update(
DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
conn->mta_conn_mutex_lock_already = FALSE;
conn->mta_conn_mutex_unlock_later = FALSE;
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
@@ -7483,58 +7331,6 @@ int spider_db_direct_update(
#endif
#endif
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_direct_update(
- ha_spider *spider,
- ha_rows *update_rows,
- ha_rows *found_rows
-) {
- int error_num = 0, roop_count, tmp_error_num;
- SPIDER_SHARE *share = spider->share;
- SPIDER_CONN *conn;
- bool counted = FALSE;
- DBUG_ENTER("spider_db_bulk_direct_update");
- for (
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, -1, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY);
- roop_count < (int) share->link_count;
- roop_count = spider_conn_link_idx_next(share->link_statuses,
- spider->conn_link_idx, roop_count, share->link_count,
- SPIDER_LINK_STATUS_RECOVERY)
- ) {
- DBUG_PRINT("info", ("spider exec sql"));
- conn = spider->conns[roop_count];
- pthread_mutex_assert_not_owner(&conn->mta_conn_mutex);
- pthread_mutex_lock(&conn->mta_conn_mutex);
- SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
- DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = TRUE;
- conn->mta_conn_mutex_unlock_later = TRUE;
- if ((tmp_error_num = spider_db_bulk_open_handler(spider, conn,
- roop_count)))
- {
- error_num = tmp_error_num;
- }
- if (!counted)
- {
- *update_rows = spider->conns[roop_count]->db_conn->affected_rows();
- DBUG_PRINT("info", ("spider update_rows = %llu", *update_rows));
- *found_rows = spider->conns[roop_count]->db_conn->matched_rows();
- DBUG_PRINT("info", ("spider found_rows = %llu", *found_rows));
- counted = TRUE;
- }
- DBUG_ASSERT(conn->mta_conn_mutex_lock_already);
- DBUG_ASSERT(conn->mta_conn_mutex_unlock_later);
- conn->mta_conn_mutex_lock_already = FALSE;
- conn->mta_conn_mutex_unlock_later = FALSE;
- SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
- pthread_mutex_unlock(&conn->mta_conn_mutex);
- }
- DBUG_RETURN(error_num);
-}
-#endif
int spider_db_bulk_delete(
ha_spider *spider,
@@ -7733,13 +7529,6 @@ int spider_db_direct_delete(
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (spider->is_bulk_access_clone)
- {
- spider->connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
- } else {
-#endif
conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -7823,9 +7612,6 @@ int spider_db_direct_delete(
DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows));
counted = TRUE;
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
@@ -7925,13 +7711,6 @@ int spider_db_direct_delete(
pthread_mutex_lock(&conn->mta_conn_mutex);
SPIDER_SET_FILE_POS(&conn->mta_conn_mutex_file_pos);
}
-#ifdef HA_CAN_BULK_ACCESS
- if (spider->is_bulk_access_clone)
- {
- spider->connection_ids[roop_count] = conn->connection_id;
- spider_trx_add_bulk_access_conn(spider->wide_handler->trx, conn);
- } else {
-#endif
conn->need_mon = &spider->need_mons[roop_count];
DBUG_ASSERT(!conn->mta_conn_mutex_lock_already);
DBUG_ASSERT(!conn->mta_conn_mutex_unlock_later);
@@ -8015,9 +7794,6 @@ int spider_db_direct_delete(
DBUG_PRINT("info", ("spider delete_rows = %llu", *delete_rows));
counted = TRUE;
}
-#ifdef HA_CAN_BULK_ACCESS
- }
-#endif
SPIDER_CLEAR_FILE_POS(&conn->mta_conn_mutex_file_pos);
pthread_mutex_unlock(&conn->mta_conn_mutex);
}
@@ -11519,20 +11295,6 @@ error:
DBUG_RETURN(error_num);
}
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_open_handler(
- ha_spider *spider,
- SPIDER_CONN *conn,
- int link_idx
-) {
- int error_num = 0;
- DBUG_ENTER("spider_db_bulk_open_handler");
- DBUG_PRINT("info",("spider spider=%p", spider));
- DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider link_idx=%d", link_idx));
- DBUG_RETURN(error_num);
-}
-#endif
int spider_db_close_handler(
ha_spider *spider,
diff --git a/storage/spider/spd_db_conn.h b/storage/spider/spd_db_conn.h
index f0821454f48..42a1303a9aa 100644
--- a/storage/spider/spd_db_conn.h
+++ b/storage/spider/spd_db_conn.h
@@ -639,14 +639,6 @@ void spider_db_discard_multiple_result(
SPIDER_CONN *conn
);
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_store_result(
- ha_spider *spider,
- SPIDER_CONN *conn,
- int link_idx,
- bool discard_result
-);
-#endif
int spider_db_fetch(
uchar *buf,
@@ -769,11 +761,6 @@ int spider_db_bulk_insert(
bool bulk_end
);
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_bulk_insert(
- ha_spider *spider
-);
-#endif
int spider_db_update_auto_increment(
ha_spider *spider,
@@ -822,12 +809,6 @@ int spider_db_direct_update(
#endif
#endif
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_direct_update(
- ha_spider *spider,
- ha_rows *update_rows
-);
-#endif
int spider_db_bulk_delete(
ha_spider *spider,
@@ -1205,13 +1186,6 @@ int spider_db_open_handler(
int link_idx
);
-#ifdef HA_CAN_BULK_ACCESS
-int spider_db_bulk_open_handler(
- ha_spider *spider,
- SPIDER_CONN *conn,
- int link_idx
-);
-#endif
int spider_db_close_handler(
ha_spider *spider,
diff --git a/storage/spider/spd_db_mysql.cc b/storage/spider/spd_db_mysql.cc
index 427cb6bc13b..8c44f66abdb 100644
--- a/storage/spider/spd_db_mysql.cc
+++ b/storage/spider/spd_db_mysql.cc
@@ -15914,11 +15914,7 @@ void spider_mbase_handler::minimum_select_bitmap_create()
memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set));
if (
spider->use_index_merge ||
-#ifdef HA_CAN_BULK_ACCESS
- (spider->is_clone && !spider->is_bulk_access_clone)
-#else
spider->is_clone
-#endif
) {
/* need preparing for cmp_ref */
TABLE_SHARE *table_share = table->s;
diff --git a/storage/spider/spd_db_oracle.cc b/storage/spider/spd_db_oracle.cc
index 3b0854e609d..08a6bd90ec4 100644
--- a/storage/spider/spd_db_oracle.cc
+++ b/storage/spider/spd_db_oracle.cc
@@ -12357,11 +12357,7 @@ void spider_oracle_handler::minimum_select_bitmap_create()
memset(minimum_select_bitmap, 0, no_bytes_in_map(table->read_set));
if (
spider->use_index_merge ||
-#ifdef HA_CAN_BULK_ACCESS
- (spider->is_clone && !spider->is_bulk_access_clone)
-#else
spider->is_clone
-#endif
) {
/* need preparing for cmp_ref */
TABLE_SHARE *table_share = table->s;
diff --git a/storage/spider/spd_include.h b/storage/spider/spd_include.h
index 37a5dcc9db1..951592c03c5 100644
--- a/storage/spider/spd_include.h
+++ b/storage/spider/spd_include.h
@@ -496,12 +496,6 @@ typedef struct st_spider_conn
Time_zone *queued_time_zone_val;
XID *queued_xa_start_xid;
-#ifdef HA_CAN_BULK_ACCESS
- uint bulk_access_requests;
- uint bulk_access_sended;
- int bulk_access_error_num;
- st_spider_conn *bulk_access_next;
-#endif
bool disable_connect_retry; /* TRUE if it is unnecessary to
retry to connect after a
@@ -630,9 +624,6 @@ typedef struct st_spider_wide_handler
longlong info_limit;
#endif
#endif
-#ifdef HA_CAN_BULK_ACCESS
- ulonglong external_lock_cnt;
-#endif
bool between_flg;
bool idx_bitmap_is_set;
bool rnd_bitmap_is_set;
@@ -708,10 +699,6 @@ typedef struct st_spider_transaction
ulonglong direct_aggregate_count;
ulonglong parallel_search_count;
-#ifdef HA_CAN_BULK_ACCESS
- SPIDER_CONN *bulk_access_conn_first;
- SPIDER_CONN *bulk_access_conn_last;
-#endif
pthread_mutex_t *udf_table_mutexes;
CHARSET_INFO *udf_access_charset;
@@ -909,9 +896,6 @@ typedef struct st_spider_share
int error_read_mode;
int error_write_mode;
int active_link_count;
-#ifdef HA_CAN_BULK_ACCESS
- int bulk_access_free;
-#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE
int force_bulk_update;
#endif
@@ -1291,17 +1275,6 @@ typedef struct st_spider_trx_ha
bool wait_for_reusing;
} SPIDER_TRX_HA;
-#ifdef HA_CAN_BULK_ACCESS
-typedef struct st_spider_bulk_access_link
-{
- ha_spider *spider;
- uint sequence_num;
- bool used;
- bool called;
- MEM_ROOT mem_root;
- st_spider_bulk_access_link *next;
-} SPIDER_BULK_ACCESS_LINK;
-#endif
#define SPIDER_INT_HLD_TGT_SIZE 100
typedef struct st_spider_int_hld
diff --git a/storage/spider/spd_param.cc b/storage/spider/spd_param.cc
index 4ee35e88f4a..64f6a36eda0 100644
--- a/storage/spider/spd_param.cc
+++ b/storage/spider/spd_param.cc
@@ -2513,34 +2513,6 @@ int spider_param_read_only_mode(
read_only_mode : THDVAR(thd, read_only_mode));
}
-#ifdef HA_CAN_BULK_ACCESS
-static int spider_bulk_access_free;
-/*
- -1 :use table parameter
- 0 :in reset
- 1 :in close
- */
-static MYSQL_SYSVAR_INT(
- bulk_access_free,
- spider_bulk_access_free,
- PLUGIN_VAR_RQCMDARG | PLUGIN_VAR_READONLY,
- "Free mode of bulk access resources",
- NULL,
- NULL,
- -1,
- -1,
- 1,
- 0
-);
-
-int spider_param_bulk_access_free(
- int bulk_access_free
-) {
- DBUG_ENTER("spider_param_bulk_access_free");
- DBUG_RETURN(spider_bulk_access_free == -1 ?
- bulk_access_free : spider_bulk_access_free);
-}
-#endif
/*
-1 :use UDF parameter
@@ -3234,9 +3206,6 @@ static struct st_mysql_sys_var* spider_system_variables[] = {
MYSQL_SYSVAR(skip_parallel_search),
MYSQL_SYSVAR(direct_order_limit),
MYSQL_SYSVAR(read_only_mode),
-#ifdef HA_CAN_BULK_ACCESS
- MYSQL_SYSVAR(bulk_access_free),
-#endif
MYSQL_SYSVAR(udf_ds_use_real_table),
MYSQL_SYSVAR(general_log),
MYSQL_SYSVAR(index_hint_pushdown),
diff --git a/storage/spider/spd_param.h b/storage/spider/spd_param.h
index 1f1d9103d18..8b544447310 100644
--- a/storage/spider/spd_param.h
+++ b/storage/spider/spd_param.h
@@ -331,11 +331,6 @@ int spider_param_read_only_mode(
THD *thd,
int read_only_mode
);
-#ifdef HA_CAN_BULK_ACCESS
-int spider_param_bulk_access_free(
- int bulk_access_free
-);
-#endif
int spider_param_udf_ds_use_real_table(
THD *thd,
int udf_ds_use_real_table
diff --git a/storage/spider/spd_table.cc b/storage/spider/spd_table.cc
index ca00e012c28..a0afadb0611 100644
--- a/storage/spider/spd_table.cc
+++ b/storage/spider/spd_table.cc
@@ -2110,9 +2110,6 @@ int spider_parse_connect_info(
share->error_read_mode = -1;
share->error_write_mode = -1;
share->active_link_count = -1;
-#ifdef HA_CAN_BULK_ACCESS
- share->bulk_access_free = -1;
-#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE
share->force_bulk_update = -1;
#endif
@@ -2242,9 +2239,6 @@ int spider_parse_connect_info(
2147483647);
SPIDER_PARAM_INT_WITH_MAX("aim", auto_increment_mode, 0, 3);
SPIDER_PARAM_INT("alc", active_link_count, 1);
-#ifdef HA_CAN_BULK_ACCESS
- SPIDER_PARAM_INT_WITH_MAX("baf", bulk_access_free, 0, 1);
-#endif
SPIDER_PARAM_INT("bfz", buffer_size, 0);
SPIDER_PARAM_LONGLONG("bfr", bgs_first_read, 0);
SPIDER_PARAM_INT("bmd", bgs_mode, 0);
@@ -2497,10 +2491,6 @@ int spider_parse_connect_info(
net_read_timeouts, 0, 2147483647);
SPIDER_PARAM_INT_WITH_MAX(
"error_write_mode", error_write_mode, 0, 1);
-#ifdef HA_CAN_BULK_ACCESS
- SPIDER_PARAM_INT_WITH_MAX(
- "bulk_access_free", bulk_access_free, 0, 1);
-#endif
SPIDER_PARAM_INT_WITH_MAX(
"query_cache_sync", query_cache_sync, 0, 3);
error_num = connect_string_parse.print_param_error();
@@ -3971,10 +3961,6 @@ int spider_set_connect_info_default(
share->error_write_mode = 0;
if (share->active_link_count == -1)
share->active_link_count = share->all_link_count;
-#ifdef HA_CAN_BULK_ACCESS
- if (share->bulk_access_free == -1)
- share->bulk_access_free = 0;
-#endif
#ifdef HA_CAN_FORCE_BULK_UPDATE
if (share->force_bulk_update == -1)
share->force_bulk_update = 0;
@@ -8327,18 +8313,10 @@ bool spider_check_direct_order_limit(
spider->use_index_merge ? "TRUE" : "FALSE"));
DBUG_PRINT("info",("spider is_clone=%s",
spider->is_clone ? "TRUE" : "FALSE"));
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_PRINT("info",("spider is_bulk_access_clone=%s",
- spider->is_bulk_access_clone ? "TRUE" : "FALSE"));
-#endif
if (
spider->wide_handler->sql_command != SQLCOM_HA_READ &&
!spider->use_index_merge &&
-#ifdef HA_CAN_BULK_ACCESS
- (!spider->is_clone || spider->is_bulk_access_clone)
-#else
!spider->is_clone
-#endif
) {
spider_get_select_limit(spider, &select_lex, &select_limit, &offset_limit);
bool first_check = TRUE;
@@ -8553,12 +8531,6 @@ Field *spider_field_exchange(
Field *field
) {
DBUG_ENTER("spider_field_exchange");
-#ifdef HA_CAN_BULK_ACCESS
- if (handler->is_bulk_access_clone)
- {
- handler = handler->pt_clone_source_handler;
- }
-#endif
DBUG_PRINT("info",("spider in field=%p", field));
DBUG_PRINT("info",("spider in field->table=%p", field->table));
DBUG_PRINT("info",("spider table=%p", handler->get_table()));
diff --git a/storage/spider/spd_trx.cc b/storage/spider/spd_trx.cc
index f749a9ef8a5..11b0e420ed3 100644
--- a/storage/spider/spd_trx.cc
+++ b/storage/spider/spd_trx.cc
@@ -3255,11 +3255,6 @@ int spider_commit(
if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr)))
DBUG_RETURN(0); /* transaction is not started */
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
- trx->bulk_access_conn_first));
- trx->bulk_access_conn_first = NULL;
-#endif
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
@@ -3347,11 +3342,6 @@ int spider_rollback(
if (!(trx = (SPIDER_TRX*) thd_get_ha_data(thd, spider_hton_ptr)))
DBUG_RETURN(0); /* transaction is not started */
-#ifdef HA_CAN_BULK_ACCESS
- DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
- trx->bulk_access_conn_first));
- trx->bulk_access_conn_first = NULL;
-#endif
if (all || (!thd_test_options(thd, OPTION_NOT_AUTOCOMMIT | OPTION_BEGIN)))
{
@@ -4066,34 +4056,3 @@ int spider_trx_check_link_idx_failed(
DBUG_RETURN(0);
}
-#ifdef HA_CAN_BULK_ACCESS
-void spider_trx_add_bulk_access_conn(
- SPIDER_TRX *trx,
- SPIDER_CONN *conn
-) {
- DBUG_ENTER("spider_trx_add_bulk_access_conn");
- DBUG_PRINT("info",("spider trx=%p", trx));
- DBUG_PRINT("info",("spider conn=%p", conn));
- DBUG_PRINT("info",("spider conn->bulk_access_requests=%u",
- conn->bulk_access_requests));
- DBUG_PRINT("info",("spider conn->bulk_access_sended=%u",
- conn->bulk_access_sended));
- DBUG_PRINT("info",("spider trx->bulk_access_conn_first=%p",
- trx->bulk_access_conn_first));
- if (!conn->bulk_access_requests && !conn->bulk_access_sended)
- {
- if (!trx->bulk_access_conn_first)
- {
- trx->bulk_access_conn_first = conn;
- } else {
- trx->bulk_access_conn_last->bulk_access_next = conn;
- }
- trx->bulk_access_conn_last = conn;
- conn->bulk_access_next = NULL;
- }
- conn->bulk_access_requests++;
- DBUG_PRINT("info",("spider conn->bulk_access_requests=%u",
- conn->bulk_access_requests));
- DBUG_VOID_RETURN;
-}
-#endif
diff --git a/storage/spider/spd_trx.h b/storage/spider/spd_trx.h
index 3bf93aada1a..2055a49717e 100644
--- a/storage/spider/spd_trx.h
+++ b/storage/spider/spd_trx.h
@@ -266,9 +266,3 @@ int spider_trx_check_link_idx_failed(
ha_spider *spider
);
-#ifdef HA_CAN_BULK_ACCESS
-void spider_trx_add_bulk_access_conn(
- SPIDER_TRX *trx,
- SPIDER_CONN *conn
-);
-#endif